Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
06ad721
)
THRIFT-2359 TBufferedTransport doesn't clear it's buffer on a failed flush call
author
Jens Geyer
<jensg@apache.org>
Tue, 18 Feb 2014 20:55:43 +0000
(21:55 +0100)
committer
Jens Geyer
<jensg@apache.org>
Tue, 18 Feb 2014 20:55:43 +0000
(21:55 +0100)
Patch: Chris Trotman
lib/php/lib/Thrift/Transport/TBufferedTransport.php
patch
|
blob
|
history
diff --git
a/lib/php/lib/Thrift/Transport/TBufferedTransport.php
b/lib/php/lib/Thrift/Transport/TBufferedTransport.php
index
0d3ad98
..
270c004
100644
(file)
--- a/
lib/php/lib/Thrift/Transport/TBufferedTransport.php
+++ b/
lib/php/lib/Thrift/Transport/TBufferedTransport.php
@@
-156,8
+156,13
@@
class TBufferedTransport extends TTransport {
public function flush() {
if (TStringFuncFactory::create()->strlen($this->wBuf_) > 0) {
- $this->transport_->write($this->wBuf_);
+ $out = $this->wBuf_;
+
+ // Note that we clear the internal wBuf_ prior to the underlying write
+ // to ensure we're in a sane state (i.e. internal buffer cleaned)
+ // if the underlying write throws up an exception
$this->wBuf_ = '';
+ $this->transport_->write($out);
}
$this->transport_->flush();
}