From: Marcus Boerger Date: Wed, 2 Oct 2002 15:02:16 +0000 (+0000) Subject: Revisted Wez patch: chunk_size 0 means cahce the whole output. So X-Git-Tag: MODERN_SYMMETRIC_SESSION_BEHAVIOUR_20021003~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4bba6d158b75128c590dc6de7ec07ccbdf2a7c9;p=php Revisted Wez patch: chunk_size 0 means cahce the whole output. So 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. --- diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index ffec5e8437..fb2e6ce55e 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -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; diff --git a/main/output.c b/main/output.c index 9a5a53a781..bbf0807231 100644 --- a/main/output.c +++ b/main/output.c @@ -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;