From 29f5f67e1fafdd9ef263b59f2d93c347d2209c44 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Thu, 28 Sep 2006 03:19:03 +0000 Subject: [PATCH] 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 --- lib/php/src/transport/TSocket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/php/src/transport/TSocket.php b/lib/php/src/transport/TSocket.php index 5ecd8740..5ca23e72 100644 --- a/lib/php/src/transport/TSocket.php +++ b/lib/php/src/transport/TSocket.php @@ -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) { -- 2.17.1