Browse files

Fixed TSocket timeout issue with patch https://issues.apache.org/jira…

  • Loading branch information...
1 parent 6722c2f commit 5d4d3ee4711c996eafa2283306c62a6ec64908d0 @jylinman committed Apr 8, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 vendor/phpcassa/thrift/transport/TSocket.php
View
4 vendor/phpcassa/thrift/transport/TSocket.php
@@ -222,7 +222,7 @@ public function readAll($len) {
$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']) {
throw new TException('TSocket: timed out reading '.$len.' bytes from '.
@@ -233,7 +233,7 @@ public function readAll($len) {
}
} 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 TException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {

0 comments on commit 5d4d3ee

Please sign in to comment.