From:             
Operating system: Windows
PHP version:      5.3.8
Package:          HTTP related
Bug Type:         Bug
Bug description:file_get_contents doesn't stop retrieving data

Description:
------------
When I send request to script connection_close.php from web browser
(Internet Explorer, Firefox or Opera), it returns only "1".
connection_close.php is run on Apache 2.2 web server.

But when I execute this script from other php file via file_get_contents
(eg. do_request.php), it returns "12".

Test script:
---------------
file connection_close.php:
<?php
ob_start();
print '1';
header("Connection: close");
header("Content-Length: 1");
ob_end_flush();
flush();

sleep(2);
print '2';
?>

file do_request.php:
<?php
print file_get_contents("http://web_server_path/connection_close.php";);
?>

Expected result:
----------------
Executing do_request.php should return "1".

Actual result:
--------------
do_request.php returns "12".

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

Reply via email to