Bug #60465 [Opn->Ana]: file_get_contents doesn't stop retrieving data
| From: | laruence@php.net | Date: | Tue, 13 Dec 2011 04:14:48 +0000 |
| Subject: | Bug #60465 [Opn->Ana]: file_get_contents doesn't stop retrieving data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165833@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60465&edit=1
ID: 60465
Updated by: laruence@php.net
Reported by: dbc334 at gmail dot com
Summary: file_get_contents doesn't stop retrieving data
-Status: Open
+Status: Analyzed
Type: Bug
Package: HTTP related
Operating System: Windows
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
it seems improper to use php_steam_eof while parsing header in
php_stream_url_wrap_http_ex.
Previous Comments:
------------------------------------------------------------------------
[2011-12-08 00:22:33] dbc334 at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=60465&edit=1