if (http->data_encoding == HTTP_ENCODING_CHUNKED)
bytes = http_write_chunk(http, http->wbuffer, http->wused);
else
+ {
bytes = http_write(http, http->wbuffer, http->wused);
+ if (bytes > 0 && http->data_encoding == HTTP_ENCODING_LENGTH)
+ {
+ http->data_remaining -= bytes;
+
+ if (http->data_remaining <= 0)
+ {
+ }
+ }
+ }
+
http->wused = 0;
DEBUG_printf(("1httpFlushWrite: Returning %d, errno=%d.", bytes, errno));
* data, go idle...
*/
+#ifdef HAVE_LIBZ
+ if (http->coding)
+ http_content_coding_finish(http);
+#endif /* HAVE_LIBZ */
+
if (http->wused)
{
if (httpFlushWrite(http) < 0)
}
if (http->state == HTTP_STATE_POST_RECV)
- {
-#ifdef HAVE_LIBZ
- if (http->coding)
- http_content_coding_finish(http);
-#endif /* HAVE_LIBZ */
-
http->state ++;
+ else
+ http->state = HTTP_STATE_WAITING;
- DEBUG_printf(("2httpWrite2: Changed state to %s.",
- http_states[http->state + 1]));
- }
+ DEBUG_printf(("2httpWrite2: Changed state to %s.",
+ http_states[http->state + 1]));
}
DEBUG_printf(("1httpWrite2: Returning " CUPS_LLFMT ".", CUPS_LLCAST bytes));
ipp-2.2.test \
ipp-everywhere.test \
print-job.test \
+ print-job-deflate.test \
print-job-gzip.test
OBJS = \
ippserver.o \
#
# Do all of the IPP/1.1 and IPP/2.0 tests
-#INCLUDE "ipp-2.0.test"
+INCLUDE "ipp-2.0.test"
# Test required printer description attribute support.
if (httpError(client->http) == EPIPE)
fprintf(stderr, "%s Client closed connection.\n", client->hostname);
else
- fprintf(stderr, "%s Bad request line.\n", client->hostname);
+ fprintf(stderr, "%s Bad request line (%s).\n", client->hostname,
+ strerror(httpError(client->http)));
return (0);
}
else if (!_cups_strcasecmp(ext, ".ps") ||
!_cups_strcasecmp(ext, ".ps.gz"))
set_variable(&vars, "filetype", "application/postscript");
- else if (!_cups_strcasecmp(ext, ".ras") ||
+ else if (!_cups_strcasecmp(ext, ".pwg") ||
+ !_cups_strcasecmp(ext, ".pwg.gz") ||
+ !_cups_strcasecmp(ext, ".ras") ||
!_cups_strcasecmp(ext, ".ras.gz"))
set_variable(&vars, "filetype", "image/pwg-raster");
else if (!_cups_strcasecmp(ext, ".txt") ||
--- /dev/null
+# Print a test page using print-job and compression=gzip
+{
+ # The name of the test...
+ NAME "Print file using Print-Job and compression=deflate"
+
+ # The operation to use
+ OPERATION Print-Job
+
+ # Attributes, starting in the operation group...
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR mimeMediaType document-format $filetype
+ ATTR keyword compression deflate
+
+ GROUP job-attributes-tag
+ ATTR integer copies 1
+
+ COMPRESSION deflate
+ FILE $filename
+
+ # What statuses are OK?
+ STATUS successful-ok
+ STATUS successful-ok-ignored-or-substituted-attributes
+
+ # What attributes do we expect?
+ EXPECT job-id
+ EXPECT job-uri
+}
cp test/onepage-*.pdf $pkgdir
cp test/onepage-*.ps $pkgdir
cp test/print-job.test $pkgdir
+cp test/print-job-deflate.test $pkgdir
cp test/print-job-gzip.test $pkgdir
cp test/testfile.* $pkgdir