You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2010/11/19 01:06:52 UTC
svn commit: r1036684 - /thrift/trunk/lib/php/src/transport/TSocket.php
Author: bryanduxbury
Date: Fri Nov 19 00:06:51 2010
New Revision: 1036684
URL: http://svn.apache.org/viewvc?rev=1036684&view=rev
Log:
THRIFT-347. php: PHP TSocket Timeout Issues
This patch appears to correct the infamous timeout issues.
Patch: Tyler Hobbs
Modified:
thrift/trunk/lib/php/src/transport/TSocket.php
Modified: thrift/trunk/lib/php/src/transport/TSocket.php
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/php/src/transport/TSocket.php?rev=1036684&r1=1036683&r2=1036684&view=diff
==============================================================================
--- thrift/trunk/lib/php/src/transport/TSocket.php (original)
+++ thrift/trunk/lib/php/src/transport/TSocket.php Fri Nov 19 00:06:51 2010
@@ -241,9 +241,9 @@ class TSocket extends TTransport {
$pre = null;
while (TRUE) {
$buf = @fread($this->handle_, $len);
- if ($buf === FALSE || $buf === '') {
+ if ($buf === FALSE) {
$md = stream_get_meta_data($this->handle_);
- if ($md['timed_out']) {
+ if (true === $md['timed_out'] && false === $md['blocked']) {
throw new TTransportException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {
@@ -252,7 +252,7 @@ class TSocket extends TTransport {
}
} else if (($sz = strlen($buf)) < $len) {
$md = stream_get_meta_data($this->handle_);
- if ($md['timed_out']) {
+ if (true === $md['timed_out'] && false === $md['blocked']) {
throw new TTransportException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {
@@ -277,9 +277,9 @@ class TSocket extends TTransport {
$this->sendTimeoutSet_ = FALSE;
}
$data = @fread($this->handle_, $len);
- if ($data === FALSE || $data === '') {
+ if ($data === FALSE) {
$md = stream_get_meta_data($this->handle_);
- if ($md['timed_out']) {
+ if (true === $md['timed_out'] && false === $md['blocked']) {
throw new TTransportException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {