From:             bfra...@php.net
Operating system: 
PHP version:      5.3.1
PHP Bug Type:     Apache2 related
Bug description:  All Apache SAPI sets content length wrong

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 bug report at http://bugs.php.net/?id=50940&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50940&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50940&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50940&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50940&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50940&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50940&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50940&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50940&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50940&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50940&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50940&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50940&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50940&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50940&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50940&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50940&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50940&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50940&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50940&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50940&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50940&r=mysqlcfg

Reply via email to