]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix a bug in the status reading code when sending a compressed data stream to an...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 19 Feb 2014 16:49:29 +0000 (16:49 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 19 Feb 2014 16:49:29 +0000 (16:49 +0000)
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

CHANGES-1.7.txt
cups/http.c

index 6905fa9caf595acb6011c7f5573d04d1219b7c17..3f67b25170af0ffebe97f5f5efe2e6f16e6a6602 100644 (file)
@@ -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 (<rdar://problem/16019623>)
        - The IPP backend might not include all job attributes in Validate-Job
          operations (<rdar://problem/16025435>)
        - Fixed some clang-reported issues (<rdar://problem/15936066>)
index 18ca6fbc5d02aaef015a500343d259f254d9492a..5909c1396adc4e0cf0138615921c1752b8fce2a5 100644 (file)
@@ -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 */