#27424 [NEW]: flush sets SG(headers_sent) to true preventing sapi_send_headers from running
| From: | scottmacvicar at ntlworld dot com | Date: | Fri, 27 Feb 2004 16:21:29 +0000 |
| Subject: | #27424 [NEW]: flush sets SG(headers_sent) to true preventing sapi_send_headers from running | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-55662@lists.php.net to get a copy of this message | ||
From: scottmacvicar at ntlworld dot com
Operating system: All
PHP version: 4CVS-2004-02-27 (stable)
PHP Bug Type: Apache2 related
Bug description: flush sets SG(headers_sent) to true preventing sapi_send_headers from running
Description:
------------
If you have zlib.output_compression = On in php.ini and echo some content
then flush under apache 2 then you'll get some binary data due to the lack
of headers.
I've had a look at the code and when you call flush() under Apache 2 it
has
SG(headers_sent) = 1;
sapi_apache2.c line 265
During php_request_shutdown() sapi_send_headers is called to add
appropriate gzip headers.
Within sapi_send_headers there is a check to see if headers have already
been sent. SAPI.c line 701.
I've read previous bug reports on flush and Apache 2 in particular, bug
#25701. Ilia mentions that Apache 2 and Apache 1 behave differently, on
flush Apache 2 sends any pending headers but in this case the gzip headers
haven't been added yet.
I can see two ways to handle this,
Disable zlib.output_compression if flush is called
or
Make flush do nothing if zlib.output_compression is enabled
--
Edit bug report at http://bugs.php.net/?id=27424&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27424&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27424&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27424&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27424&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27424&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27424&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27424&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27424&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27424&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27424&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27424&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27424&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27424&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27424&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27424&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27424&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27424&r=float