Check for empty buf on socket read
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664809 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/transport/TSocket.php b/lib/php/src/transport/TSocket.php
index 5ecd874..5ca23e7 100644
--- a/lib/php/src/transport/TSocket.php
+++ b/lib/php/src/transport/TSocket.php
@@ -169,9 +169,9 @@
// $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) {