THRIFT-867. php: PHP accelerator module's output transport is incompatible with TFram...
authorBryan Duxbury <bryanduxbury@apache.org>
Fri, 4 Mar 2011 01:35:17 +0000 (01:35 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Fri, 4 Mar 2011 01:35:17 +0000 (01:35 +0000)
This patch prevents TFramedTransport from flushing empty frames.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1076918 13f79535-47bb-0310-9956-ffa450edef68

lib/php/src/transport/TFramedTransport.php

index dc57392..b1c0bb5 100644 (file)
@@ -161,7 +161,7 @@ class TFramedTransport extends TTransport {
    * followed by the actual data.
    */
   public function flush() {
-    if (!$this->write_) {
+    if (!$this->write_ || strlen($this->wBuf_) == 0) {
       return $this->transport_->flush();
     }