sr              Thu Aug 28 12:05:18 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src    NEWS 
    /php-src/ext/zlib   zlib.c 
  Log:
  MFH: Fixed bug #25218 ("deflate" compressed pages had a gzip header, which
  should only be sent with "gzip" compressed pages).
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.363 php-src/NEWS:1.1247.2.364
--- php-src/NEWS:1.1247.2.363   Thu Aug 28 10:36:49 2003
+++ php-src/NEWS        Thu Aug 28 12:05:17 2003
@@ -7,6 +7,7 @@
 - Fixed bug #25239 (ftp_fopen_wrapper not RFC compliant). (Sara)
 - Fixed bug #25166 (WDDX serializer handler missing in win32). (Jani)
 - Fixed bug #25109 (Possible crash when fetching field names in pgsql). (Ilia)
+- Fixed bug #25218 ("deflate" compressed pages had a gzip header). (Stefan)
 
 25 Aug 2003, Version 4.3.3
 - Upgraded the bundled Expat library to version 1.95.6. (Jani)
Index: php-src/ext/zlib/zlib.c
diff -u php-src/ext/zlib/zlib.c:1.153.2.13 php-src/ext/zlib/zlib.c:1.153.2.14
--- php-src/ext/zlib/zlib.c:1.153.2.13  Sun Aug 10 21:57:10 2003
+++ php-src/ext/zlib/zlib.c     Thu Aug 28 12:05:17 2003
@@ -18,7 +18,7 @@
    |          Jade Nicoletti <[EMAIL PROTECTED]>                           |
    +----------------------------------------------------------------------+
  */
-/* $Id: zlib.c,v 1.153.2.13 2003/08/11 01:57:10 sniper Exp $ */
+/* $Id: zlib.c,v 1.153.2.14 2003/08/28 16:05:17 sr Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -687,7 +687,7 @@
        Bytef *buffer;
        uInt prev_outlen, outlen;
        int err;
-       int start_offset = (do_start?10:0);
+       int start_offset = ((do_start && ZLIBG(compression_coding) == CODING_GZIP) ? 
10 : 0);
        int end_offset = (do_end?8:0);
 
        outlen = (uint)(sizeof(char) * (str_length * 1.001f + 12) + 1); /* leave some 
room for a trailing \0 */
@@ -764,14 +764,14 @@
        ZLIBG(stream).next_in = (Bytef*) str;
        ZLIBG(stream).avail_in = (uInt) str_length;
 
-       if (ZLIBG(compression_coding) == 1) {
+       if (ZLIBG(compression_coding) == CODING_GZIP) {
                ZLIBG(crc) = crc32(ZLIBG(crc), (const Bytef *) str, str_length);
        }
 
        err = php_do_deflate(str_length, (Bytef **) newstr, new_length, do_start, 
do_end TSRMLS_CC);
        /* TODO: error handling (err may be Z_STREAM_ERROR, Z_BUF_ERROR, ?) */
 
-       if (do_start) {
+       if (do_start && ZLIBG(compression_coding) == CODING_GZIP) {
                /* Write a very simple .gz header: */
                (*newstr)[0] = gz_magic[0];
                (*newstr)[1] = gz_magic[1];
@@ -781,7 +781,7 @@
                *new_length += 10;
        }
        if (do_end) {
-               if (ZLIBG(compression_coding) == 1) {
+               if (ZLIBG(compression_coding) == CODING_GZIP) {
                        char *trailer = (*newstr)+(*new_length);
 
                        /* write crc & stream.total_in in LSB order */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to