Bug #60465 [Com]: file_get_contents doesn't stop retrieving data

From: Date: Sun, 13 Jul 2014 10:40:06 +0000
Subject: Bug #60465 [Com]: file_get_contents doesn't stop retrieving data
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186594@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 Comment by: dbc334 at gmail dot com Reported by: dbc334 at gmail dot com Summary: file_get_contents doesn't stop retrieving data Status: Closed Type: Bug Package: HTTP related Operating System: Windows PHP Version: 5.3.8 Assigned To: rasmus Block user comment: N Private report: N New Comment: This still doesn't work as it should on 5.5.14 (Windows). Previous Comments: ------------------------------------------------------------------------ [2014-07-13 01:52:56] yohgaki@php.net Oops. This bug report is for infinite read. Anyway, 5.4 and 5.5 finish reading it. Closing bug. ------------------------------------------------------------------------ [2014-07-13 01:46:35] yohgaki@php.net file_get_contents() has maxlen parameter now. http://php.net/manual/en/function.file-get-contents.php I guess this could be closed. ------------------------------------------------------------------------ [2011-12-20 02:26:11] laruence@php.net Rasmus, plz look at this one, thanks ------------------------------------------------------------------------ [2011-12-13 04:14:48] laruence@php.net it seems improper to use php_steam_eof while parsing header in php_stream_url_wrap_http_ex. ------------------------------------------------------------------------ [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

« previous php.bugs (#186594) next »