Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression)

This commit is contained in:
Xinchen Hui 2012-07-21 02:56:28 +08:00
parent a2a1cef1a2
commit a6f1533789
3 changed files with 8 additions and 1 deletions

4
NEWS
View File

@ -39,6 +39,10 @@ PHP NEWS
. Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build).
(Laruence)
- Zlib:
. Fixed bug #55544 (ob_gzhandler always conflicts with
zlib.output_compression). (Laruence)
?? ??? 2012, PHP 5.4.5
- Core:

View File

@ -52,6 +52,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
int compression_coding;
long output_compression;
long output_compression_level;
long output_compression_default;
char *output_handler;
php_zlib_context *ob_gzhandler;
ZEND_END_MODULE_GLOBALS(zlib);

View File

@ -890,6 +890,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
status = OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
ZLIBG(output_compression) = ZLIBG(output_compression_default);
if (stage == PHP_INI_STAGE_RUNTIME && int_value) {
if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) {
php_zlib_output_compression_start(TSRMLS_C);
@ -914,7 +915,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_handler)
/* {{{ INI */
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals)
STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression_default, zend_zlib_globals, zlib_globals)
STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdateLong, output_compression_level, zend_zlib_globals, zlib_globals)
STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals)
PHP_INI_END()
@ -958,6 +959,7 @@ 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);