summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-08-11 01:11:11 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-08-11 01:11:11 +0000
commit02ed7058187c8edf47adccfd0924bbd7400992c4 (patch)
tree4e395487d7139a53aeb8589f3795e68965c7e265 /ext/zlib
parent7aa98ff852b9fdac2f5cc830f7ea4259c2fb7080 (diff)
downloadphp-git-02ed7058187c8edf47adccfd0924bbd7400992c4.tar.gz
Generally speaking, sending packets less than 1KB is not efficient.
We're better to take some benchmarks see if removing extra buffer is actually a good idea or not.
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index d5501fd921..06b0446db6 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -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);
}