Browse Source

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.
migration/unlabaled-1.1.2
Marcus Boerger 24 years ago
parent
commit
d4bba6d158
  1. 6
      ext/zlib/zlib.c
  2. 4
      main/output.c

6
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;

4
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;

Loading…
Cancel
Save