|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21838 no error reporting on timed out read()
Submitted: 2003-01-23 04:52 UTC Modified: 2003-07-27 12:43 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: pavlomr at hotmail dot com Assigned: shane (profile)
Status: Closed Package: PEAR related
PHP Version: 4.3.0 OS: SuSE Linux 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: pavlomr at hotmail dot com
New email:
PHP Version: OS:


 [2003-01-23 04:52 UTC] pavlomr at hotmail dot com
I have encountered mysterious time-to-time "Invalid HTTP Response" errors on slow links.
The problem was socket read() timeout in Transport/HTTP.php
I think reporting timeouts as own soap fault helps in debugging SOAP-based applications.
I propose next patch for Transport/HTTP.php :

--- HTTP.php.b  2003-01-23 12:19:53.000000000 +0200
+++ HTTP.php    2003-01-23 12:25:57.000000000 +0200
@@ -307,9 +307,15 @@
         // get reponse
         // XXX time consumer

-        while ($data = fread($fp, 32768)) {
-            $this->incoming_payload .= $data;
-        }
+        do {
+            $data=fread($fp,4096);
+            $_tmp_status=socket_get_status($fp);
+            if ($_tmp_status["timed_out"]) {
+                return $this->_raiseSoapFault("Timed out read from $host");
+            } else {
+                $this->incoming_payload.=$data;
+            }
+        } while ( !$_tmp_status["eof"] );



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-26 08:42 UTC]
Just saw this old bug report. This was corrected in a recent release iirc.
 [2003-07-21 10:49 UTC]
the current version has a timeout error handling but no timeout error reporting, this patch would do it..

 [2003-07-27 10:40 UTC]
sure, but do we want to report this error? 

Btw are you sure that the timeout doesn't print out an error? 


Need feedback because I can't reproduce it.
 [2003-07-27 12:41 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

 [2003-07-27 12:43 UTC]
I did not see that patch earlier when browsing. It will be part of next release.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 14:03:37 2021 UTC