#21838 [NEW]: no error reporting on timed out read()

From: Date: Thu, 23 Jan 2003 10:52:38 +0000
Subject: #21838 [NEW]: no error reporting on timed out read()
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12679@lists.php.net to get a copy of this message
From: pavlomr@hotmail.com Operating system: SuSE Linux 7.3 PHP version: 4.3.0 PHP Bug Type: PEAR related Bug description: no error reporting on timed out read() 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"] ); fclose($fp); -- Edit bug report at http://bugs.php.net/?id=21838&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21838&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21838&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21838&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21838&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21838&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21838&r=support Expected behavior: http://bugs.php.net/fix.php?id=21838&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21838&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21838&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21838&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21838&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21838&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21838&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21838&r=gnused

« previous php.pear.dev (#12679) next »