#21838 [Opn->Asn]: no error reporting on timed out read()

From: Date: Mon, 26 May 2003 13:42:35 +0000
Subject: #21838 [Opn->Asn]: no error reporting on timed out read()
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16705@lists.php.net to get a copy of this message
ID: 21838 Updated by: arnaud@php.net Reported By: pavlomr at hotmail dot com -Status: Open +Status: Assigned Bug Type: PEAR related Operating System: SuSE Linux 7.3 PHP Version: 4.3.0 -Assigned To: +Assigned To: shane New Comment: Just saw this old bug report. This was corrected in a recent release iirc. Previous Comments: ------------------------------------------------------------------------ [2003-01-23 04:52:38] 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"] ); fclose($fp); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21838&edit=1

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