diff options
author | Xinchen Hui <laruence@php.net> | 2012-07-24 14:43:53 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-07-24 14:43:53 +0800 |
commit | 4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe (patch) | |
tree | 23d38763092a8e1ac94b50e999561f0a08734087 /ext/zlib/zlib.c | |
parent | 2abc4c2f6fabfc81d12380170dc5ec7be9314a61 (diff) | |
download | php-git-4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe.tar.gz |
Re-fix bug #55544
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r-- | ext/zlib/zlib.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index eac757bbc5..7ff2b30c4c 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -263,6 +263,8 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name ZLIBG(output_compression) = chunk_size ? chunk_size : PHP_OUTPUT_HANDLER_DEFAULT_SIZE; } + ZLIBG(handler_registered) = 1; + if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) { php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC); } @@ -964,9 +966,10 @@ static PHP_MSHUTDOWN_FUNCTION(zlib) static PHP_RINIT_FUNCTION(zlib) { ZLIBG(compression_coding) = 0; - ZLIBG(output_compression) = ZLIBG(output_compression_default); - - php_zlib_output_compression_start(TSRMLS_C); + if (!ZLIBG(handler_registered)) { + ZLIBG(output_compression) = ZLIBG(output_compression_default); + php_zlib_output_compression_start(TSRMLS_C); + } return SUCCESS; } @@ -976,6 +979,7 @@ static PHP_RINIT_FUNCTION(zlib) static PHP_RSHUTDOWN_FUNCTION(zlib) { php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C); + ZLIBG(handler_registered) = 0; return SUCCESS; } @@ -1000,6 +1004,7 @@ static PHP_MINFO_FUNCTION(zlib) static ZEND_MODULE_GLOBALS_CTOR_D(zlib) { zlib_globals->ob_gzhandler = NULL; + zlib_globals->handler_registered = 0; } /* }}} */ |