Bug #55544 [ReO->Csd]: ob_gzhandler always conflicts with zlib.output_compression

From: Date: Tue, 24 Jul 2012 06:55:04 +0000
Subject: Bug #55544 [ReO->Csd]: ob_gzhandler always conflicts with zlib.output_compression
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172195@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55544&edit=1

 ID:                 55544
 Updated by:         laruence@php.net
 Reported by:        diogin at gmail dot com
 Summary:            ob_gzhandler always conflicts with
                     zlib.output_compression
-Status:             Re-Opened
+Status:             Closed
 Type:               Bug
 Package:            Output Control
 Operating System:   Windows XP SP3 x86
 PHP Version:        5.4.0alpha3
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

re-fixed agian...


Previous Comments:
------------------------------------------------------------------------
[2012-07-24 06:44:41] laruence@php.net

Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe
Log: Re-fix bug #55544

------------------------------------------------------------------------
[2012-07-24 06:42:27] laruence@php.net

Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe
Log: Re-fix bug #55544

------------------------------------------------------------------------
[2012-07-24 06:17:34] laruence@php.net

here is the confusion(assuming -d output_handler=ob_gzhandler -d 
zlib.output_compression=0) :

1. php.output_handler will change the ZLIGB(output_compression) before the zlib 
RINIT 
2. in zlib RINIT, we set the ZLIBG(output_compression) to default value(ini)

3. if we don't override the ZLIBG(output_compression), then in the 
php_zlib_output_compression_start which will be called in RINT will try to start 
zlib compression handler (although it depends on the requeset header), then, the 
conflict warning will be threw.

4. if we override it, then it the php_zlib_output_compression_start, it will 
return FALIURE, and no compression occurred(see the codes from my previous 
reply)

so, the key problem is multi-featrues depends on one global flag -> 
ZLIBG(output_compression).

------------------------------------------------------------------------
[2012-07-24 05:12:35] laruence@php.net

Here is the problem
ext/zlib/zlib.c
@@ -205,7 +205,7 @@ static int php_zlib_output_handler(void **handler_context, 
php_output_context *o
 		if (SUCCESS == 
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags TSRMLS_CC)) {
 			/* only run this once */
 			if (!(flags & PHP_OUTPUT_HANDLER_STARTED)) {
				if (SG(headers_sent) || 
!ZLIBG(output_compression)) {  

seems we need a bigger work to resolve this

------------------------------------------------------------------------
[2012-07-24 03:33:54] laruence@php.net

oh, I mis-understand your codes,  verified.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=55544


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55544&edit=1


Thread (25 messages)

« previous php.bugs (#172195) next »