]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix deflate/inflate - no zlib header.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 31 Jan 2013 13:26:54 +0000 (13:26 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 31 Jan 2013 13:26:54 +0000 (13:26 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10846 7a7537e8-13f0-0310-91df-b6672ffda945

cups/http.c

index 3c7fc99f623bdbee45361698093df15839ea092a..c437a50ce6ae123865aadad997eab289e95e653f 100644 (file)
@@ -4247,9 +4247,15 @@ http_content_coding_start(
         if (http->wused)
           httpFlushWrite(http);
 
+       /*
+        * Window size for compression is 11 bits - optimal based on PWG Raster
+        * sample files on pwg.org.  -11 is raw deflate, 27 is gzip, per ZLIB
+        * documentation.
+        */
+
         if ((zerr = deflateInit2(&(http->stream), Z_DEFAULT_COMPRESSION,
                                  Z_DEFLATED,
-                                coding == _HTTP_CODING_DEFLATE ? 11 : 27, 7,
+                                coding == _HTTP_CODING_DEFLATE ? -11 : 27, 7,
                                 Z_DEFAULT_STRATEGY)) < Z_OK)
         {
           http->status = HTTP_ERROR;
@@ -4267,8 +4273,13 @@ http_content_coding_start(
           return;
         }
 
+       /*
+        * Window size for decompression is up to 15 bits (maximum supported).
+        * -15 is raw inflate, 31 is gunzip, per ZLIB documentation.
+        */
+
         if ((zerr = inflateInit2(&(http->stream),
-                                 coding == _HTTP_CODING_INFLATE ? 15 : 31))
+                                 coding == _HTTP_CODING_INFLATE ? -15 : 31))
                < Z_OK)
         {
           free(http->dbuffer);