#50940 [Opn->Csd]: All Apache SAPI sets content length wrong
| From: | rasmus@php.net | Date: | Fri, 05 Feb 2010 18:59:52 +0000 |
| Subject: | #50940 [Opn->Csd]: All Apache SAPI sets content length wrong | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-147256@lists.php.net to get a copy of this message | ||
ID: 50940
Updated by: rasmus@php.net
Reported By: bfrance@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] svn@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] bfrance@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