From: msweet Date: Wed, 19 Feb 2014 16:49:29 +0000 (+0000) Subject: Fix a bug in the status reading code when sending a compressed data stream to an... X-Git-Tag: v2.2b1~749 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d423d83d10adfc28f25da1e563e730a8e387871c;p=thirdparty%2Fcups.git Fix a bug in the status reading code when sending a compressed data stream to an IPP printer/server () Don't use the compression buffer when reading, don't use the decompression buffer when writing. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11613 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.7.txt b/CHANGES-1.7.txt index 6905fa9caf..3f67b25170 100644 --- a/CHANGES-1.7.txt +++ b/CHANGES-1.7.txt @@ -3,6 +3,8 @@ CHANGES-1.7.txt CHANGES IN CUPS V1.7.2 + - Fixed a bug in the status reading code when sending a compressed data + stream to an IPP printer/server () - The IPP backend might not include all job attributes in Validate-Job operations () - Fixed some clang-reported issues () diff --git a/cups/http.c b/cups/http.c index 18ca6fbc5d..5909c1396a 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1706,7 +1706,7 @@ httpPeek(http_t *http, /* I - HTTP connection */ */ #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) http_content_coding_finish(http); #endif /* HAVE_LIBZ */ @@ -1734,7 +1734,8 @@ httpPeek(http_t *http, /* I - HTTP connection */ #ifdef HAVE_LIBZ if (http->used == 0 && - (http->coding == _HTTP_CODING_IDENTITY || http->stream.avail_in == 0)) + (http->coding == _HTTP_CODING_IDENTITY || + (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0))) #else if (http->used == 0) #endif /* HAVE_LIBZ */ @@ -1777,7 +1778,7 @@ httpPeek(http_t *http, /* I - HTTP connection */ } #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) { # ifdef HAVE_INFLATECOPY int zerr; /* Decompressor error */ @@ -2009,7 +2010,7 @@ httpRead2(http_t *http, /* I - HTTP connection */ return (0); #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) { do { @@ -2158,14 +2159,15 @@ httpRead2(http_t *http, /* I - HTTP connection */ if ( #ifdef HAVE_LIBZ - (http->coding == _HTTP_CODING_IDENTITY || http->stream.avail_in == 0) && + (http->coding == _HTTP_CODING_IDENTITY || + (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0)) && #endif /* HAVE_LIBZ */ ((http->data_remaining <= 0 && http->data_encoding == HTTP_ENCODING_LENGTH) || (http->data_encoding == HTTP_ENCODING_CHUNKED && bytes == 0))) { #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding >= _HTTP_CODING_GUNZIP) http_content_coding_finish(http); #endif /* HAVE_LIBZ */ @@ -3323,7 +3325,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */ */ #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding == _HTTP_CODING_GZIP || http->coding == _HTTP_CODING_DEFLATE) { DEBUG_printf(("1httpWrite2: http->coding=%d", http->coding)); @@ -3422,7 +3424,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */ */ #ifdef HAVE_LIBZ - if (http->coding) + if (http->coding == _HTTP_CODING_GZIP || http->coding == _HTTP_CODING_DEFLATE) http_content_coding_finish(http); #endif /* HAVE_LIBZ */