]> granicus.if.org Git - php/commitdiff
Generally speaking, sending packets less than 1KB is not efficient.
authorYasuo Ohgaki <yohgaki@php.net>
Sun, 11 Aug 2002 01:11:11 +0000 (01:11 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Sun, 11 Aug 2002 01:11:11 +0000 (01:11 +0000)
We're better to take some benchmarks see if removing extra buffer
is actually a good idea or not.

ext/zlib/zlib.c

index d5501fd921af21bc604f463a5fb9c9d7bfff77d8..06b0446db6b161d9f257bd323c0171b246ebf004 100644 (file)
@@ -1013,7 +1013,9 @@ int php_enable_output_compression(int buffer_size TSRMLS_DC)
                return FAILURE;
        }
 
-       php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*3/2, "zlib output compression", 0 TSRMLS_CC);
+       if (OG(ob_nesting_level)==0)
+               php_start_ob_buffer(NULL, buffer_size, 0 TSRMLS_CC);
+       php_ob_set_internal_handler(php_gzip_output_handler, (uint)(buffer_size*3/2), "zlib output compression", 0 TSRMLS_CC);
        if (ZLIBG(output_handler) && strlen(ZLIBG(output_handler))) {
                php_start_ob_buffer_named(ZLIBG(output_handler), 0, 1 TSRMLS_CC);
        }