From d395d57d3b31d70b6d387dd757cb121df8abda06 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Tue, 27 Feb 2007 01:16:55 +0000 Subject: [PATCH] Same fix to thrift codebase Reviewed By: aditya line, and those below, will be ignored-- M php/src/Thrift.php M php/src/transport/TSocket.php M php/src/transport/TPhpStream.php git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665021 13f79535-47bb-0310-9956-ffa450edef68 --- lib/php/src/Thrift.php | 1 + lib/php/src/transport/TPhpStream.php | 2 +- lib/php/src/transport/TSocket.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/php/src/Thrift.php b/lib/php/src/Thrift.php index ab56eff0..8118e3bb 100644 --- a/lib/php/src/Thrift.php +++ b/lib/php/src/Thrift.php @@ -29,6 +29,7 @@ class TType { class TMessageType { const CALL = 1; const REPLY = 2; + const EXCEPTION = 3; } class TException extends Exception { diff --git a/lib/php/src/transport/TPhpStream.php b/lib/php/src/transport/TPhpStream.php index d650935c..1f371732 100644 --- a/lib/php/src/transport/TPhpStream.php +++ b/lib/php/src/transport/TPhpStream.php @@ -66,7 +66,7 @@ class TPhpStream extends TTransport { } public function write($buf) { - while (!empty($buf)) { + while (strlen($buf) > 0) { $got = @fwrite($this->outStream_, $buf); if ($got === 0 || $got === FALSE) { throw new Exception('TPhpStream: Could not write '.strlen($buf).' bytes'); diff --git a/lib/php/src/transport/TSocket.php b/lib/php/src/transport/TSocket.php index d02b70b4..f7ecce06 100644 --- a/lib/php/src/transport/TSocket.php +++ b/lib/php/src/transport/TSocket.php @@ -242,7 +242,7 @@ class TSocket extends TTransport { stream_set_timeout($this->handle_, 0, $this->sendTimeout_*1000); $this->sendTimeoutSet_ = TRUE; } - while (!empty($buf)) { + while (strlen($buf) > 0) { $got = @fwrite($this->handle_, $buf); if ($got === 0 || $got === FALSE) { $md = stream_get_meta_data($this->handle_); -- 2.17.1