Check for empty buf on socket read
authorMark Slee <mcslee@apache.org>
Thu, 28 Sep 2006 03:19:03 +0000 (03:19 +0000)
committerMark Slee <mcslee@apache.org>
Thu, 28 Sep 2006 03:19:03 +0000 (03:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664809 13f79535-47bb-0310-9956-ffa450edef68

lib/php/src/transport/TSocket.php

index 5ecd874..5ca23e7 100644 (file)
@@ -169,9 +169,9 @@ class TSocket extends TTransport {
     // $buf = @stream_get_contents($this->handle_, $len);
 
     $pre = null;
-    while (true) {
+    while (TRUE) {
       $buf = @fread($this->handle_, $len);
-      if ($buf === FALSE) {
+      if (!$buf) {
         throw new Exception('TSocket: Could not read '.$len.' bytes from '.
                             $this->host_.':'.$this->port_);
       } else if (($sz = strlen($buf)) < $len) {