ID: 50940 Updated by: ras...@php.net Reported By: bfra...@php.net -Status: Open +Status: Closed Bug Type: Apache2 related PHP Version: 5.3.1 New Comment:
Patch applied to all branches. Previous Comments: ------------------------------------------------------------------------ [2010-02-05 18:59:06] s...@php.net Automatic comment from SVN on behalf of rasmus Revision: http://svn.php.net/viewvc/?view=revision&revision=294571 Log: Fix bug #50940 ------------------------------------------------------------------------ [2010-02-05 18:27:21] bfra...@php.net Description: ------------ The following SAPI that handle Apache are doing the content length setting wrong: apache, apache2handler, apache2filter The problems when you do: header("Content-Length: 20"); the SAPI module would just set the header doing a table set on r->headers_out, but not update r->clength. Instead of doing a table set it should be calling ap_set_content_length, which sets clength and does the table set for you. I found this in Apache 2.x because we have a filter that appends data to the end of the content. It uses r->clength and updates with the additionally data value, but it doesn't work correctly if you use the above header PHP call. The following patch fixes the problem: http://www.brianfrance.com/software/php/sapi_content_length.txt Let me know if you have any questions. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50940&edit=1