]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix end-of-request processing for chunked, compressed input - need to break out
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 22 Dec 2012 04:39:14 +0000 (04:39 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 22 Dec 2012 04:39:14 +0000 (04:39 +0000)
of the loop to get the state transition to happen.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10781 7a7537e8-13f0-0310-91df-b6672ffda945

cups/http.c

index 371825aa108624c32bc25f448782a042776a1b63..ab8fd532d566b38ececc5a91d4a4811f26bea36d 100644 (file)
@@ -2375,8 +2375,10 @@ httpRead2(http_t *http,                  /* I - Connection to server */
           else
             bytes = 0;
 
-          if (bytes <= 0)
+          if (bytes < 0)
             return (bytes);
+          else if (bytes == 0)
+            break;
 
           http->data_remaining  -= bytes;
           http->stream.avail_in += bytes;
@@ -4361,7 +4363,9 @@ http_content_coding_start(
           return;
         }
 
-        if ((zerr = inflateInit2(&(http->stream), 32 + 15)) < Z_OK)
+        if ((zerr = inflateInit2(&(http->stream),
+                                 coding == _HTTP_CODING_INFLATE ? 15 : 31))
+               < Z_OK)
         {
           free(http->dbuffer);
           http->dbuffer = NULL;