ID: 25175 Updated by: [EMAIL PROTECTED] Reported By: phpbug at paypc dot com -Status: Open +Status: Feedback Bug Type: Output Control Operating System: Linux 2.4 PHP Version: 4.3.2
Previous Comments: ------------------------------------------------------------------------ [2003-08-20 10:32:07] [EMAIL PROTECTED] What if eliminating the following line? header("Connection-Type: Keep-Alive"); Note that HTTP/1.1 style connection is not supported in either Apache 1 or CGI SAPI. And also try to generate a null output and see how it'll work: <?php header("Connection-Type: Keep-Alive"); header('Content-Length: 0'); ?> ------------------------------------------------------------------------ [2003-08-20 07:05:31] phpbug at paypc dot com Description: ------------ Very straightforward. I have a preamble and postamble include on ALL of my main .php pages... which use ADODB session management, some PEAR, and other typical dynaweb goodies. The Content-Length header is *ALWAYS* off by about 81 bytes, as in, the ob_get_length() is always smaller than the actual size of the content sent... I've verified this with "netcat" - after trimming the headers from the reply, the content is 81 bytes larger than advertised in the Content-Length header. I observed no change in behaviour after adding the ob_clean() call into my header file. OTHERWISE, things work fine. What's the deal? Is Apache silently adding CRLF's? I am NOT using the gzhandler or transparent compression here. This is just straightforward output. =Lord Apollyon= Reproduce code: --------------- The code for all of my index.php's consist of the following: <?PHP include_once 'db_header.inc'; ................ include_once 'db_footer.inc'; ?> db_header.inc: <?php $start_time=gettimeofday(); ob_clean(); // paranoid and desperate ob_start(); header("Connection-Type: Keep-Alive"); ?> db_footer.inc contains: <?PHP if ($LOGGING) { $LOG->close(); $LOGGING=FALSE; } header('Content-Length: ' . ob_get_length()); ob_end_flush(); ?> Note: there are no blank lines at the beginning of my *.inc or *.php files. Expected result: ---------------- I would expect Content-Length to reflect the actual output size. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25175&edit=1