Thrift-1240: TBinarySerializer.php invalid serialization due to TBufferTransport not flushing last chunk of data into TMemoryBuffer
Client: php
Patch: Marimuthu Ponnambalam
Simple Serialization errors out, due to the TBufferTransport not flushing the data into TMemoryBuffer after $object->write($protocol) in TBinarySerializer.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1161968 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/protocol/TBinarySerializer.php b/lib/php/src/protocol/TBinarySerializer.php
index 2913d32..542233b 100644
--- a/lib/php/src/protocol/TBinarySerializer.php
+++ b/lib/php/src/protocol/TBinarySerializer.php
@@ -48,6 +48,7 @@
} else {
$object->write($protocol);
}
+ $protocol->getTransport()->flush();
return $transport->getBuffer();
}