mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-1564 Minor fixes to TZlibTransport
Patch: Dave Watson git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1325712 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
33eaa0f100
commit
a3410db0c8
@ -110,9 +110,15 @@ TZlibTransport::~TZlibTransport() {
|
||||
}
|
||||
|
||||
bool TZlibTransport::isOpen() {
|
||||
return (readAvail() > 0) || transport_->isOpen();
|
||||
return (readAvail() > 0) || (rstream_->avail_in > 0) || transport_->isOpen();
|
||||
}
|
||||
|
||||
bool TZlibTransport::peek() {
|
||||
return (readAvail() > 0) || (rstream_->avail_in > 0) || transport_->peek();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// READING STRATEGY
|
||||
//
|
||||
// We have two buffers for reading: one containing the compressed data (crbuf_)
|
||||
@ -253,7 +259,7 @@ void TZlibTransport::flush() {
|
||||
"flush() called after finish()");
|
||||
}
|
||||
|
||||
flushToTransport(Z_SYNC_FLUSH);
|
||||
flushToTransport(Z_FULL_FLUSH);
|
||||
}
|
||||
|
||||
void TZlibTransport::finish() {
|
||||
|
@ -144,6 +144,7 @@ class TZlibTransport : public TVirtualTransport<TZlibTransport> {
|
||||
~TZlibTransport();
|
||||
|
||||
bool isOpen();
|
||||
bool peek();
|
||||
|
||||
void open() {
|
||||
transport_->open();
|
||||
|
Loading…
Reference in New Issue
Block a user