From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4.0.6
PHP Bug Type:     Output Control
Bug description:  Fatal: ob_get_length() returns wrong value when compressed OB is on

When output buffering is on, using the gzhandler, then ob_get_length()
returns the uncompressed content length in stead of the actual (compressed)

This is fatal if a Content-Length HTTP-header is sent and the browser
implements HTTP keep-alive. The result is a web-site which appears to be
down or with extremely slow responses.

Example PHP code:



print "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 30 a's
print "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; // 30 b's
print "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 30 a's

header('Content-Length: '.ob_get_length());


If this is saved as http://localhost/ob.php then try the following wget

wget --header="Accept-Encoding: gzip" --header="Connection: close" -S
Notice that wget displays the following error message continuously:
Connection closed at byte 36. Retrying.

Also notice that the web-server told wget to expect 90 bytes (the
uncompressed payload).

Edit bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to