]> granicus.if.org Git - php/commitdiff
Revisted Wez patch: chunk_size 0 means cahce the whole output. So
authorMarcus Boerger <helly@php.net>
Wed, 2 Oct 2002 15:02:16 +0000 (15:02 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 2 Oct 2002 15:02:16 +0000 (15:02 +0000)
we must apply the default before calling php_enable_output_compression().
I have left the default setting in the rinit function even though i do think
it is not necessary.

ext/zlib/zlib.c
main/output.c

index ffec5e8437334ae31358924ec68a5026b4d640d5..fb2e6ce55eb0af555bbe71a0c60dbecf017e79fc 100644 (file)
@@ -230,8 +230,10 @@ PHP_RINIT_FUNCTION(zlib)
        ZLIBG(ob_gzhandler_status) = 0;
        ZLIBG(ob_gzip_coding) = 0;
        if (chunk_size) {
-               if (chunk_size == 1)
-                       chunk_size = 0; /* use the default size */
+               if (chunk_size == 1) {
+                       chunk_size = 4096; /* use the default size */
+                       ZLIBG(output_compression) = chunk_size;
+               }
                php_enable_output_compression(chunk_size TSRMLS_CC);
        }
        return SUCCESS;
index 9a5a53a7819fac7751ab1c9fc45fdfa46fe47888..bbf08072310498e0dcd5704e1baf3e86626d3502 100644 (file)
@@ -130,10 +130,10 @@ PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool
                return FAILURE;
        }
        if (chunk_size) {
+               if (chunk_size==1)
+                       chunk_size = 4096;
                initial_size = (chunk_size*3/2);
                block_size = chunk_size/2;
-               if (block_size == 0)
-                       block_size = 1;
        } else {
                initial_size = 40*1024;
                block_size = 10*1024;