diff options
author | David Reiss <dreiss@apache.org> | 2008-05-09 07:14:10 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2008-05-09 07:14:10 +0000 |
commit | 80097936bd1258f074a226396f9546d98d060964 (patch) | |
tree | be8903db3543110e45d9ad056a19cb1bbff10d6c /lib/cpp | |
parent | 47714584327a9a8240f28e8ef4493534a1d047ba (diff) | |
download | thrift-80097936bd1258f074a226396f9546d98d060964.tar.gz |
C++/TFramedTransport: Don't write an empty frame on flush.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665681 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib/cpp')
-rw-r--r-- | lib/cpp/src/transport/TBufferTransports.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/cpp/src/transport/TBufferTransports.cpp b/lib/cpp/src/transport/TBufferTransports.cpp index 0deef1bf8..b26fd3d3c 100644 --- a/lib/cpp/src/transport/TBufferTransports.cpp +++ b/lib/cpp/src/transport/TBufferTransports.cpp @@ -230,8 +230,10 @@ void TFramedTransport::flush() { sz_nbo = (int32_t)htonl((uint32_t)(sz_hbo)); memcpy(wBuf_.get(), (uint8_t*)&sz_nbo, sizeof(sz_nbo)); - // Write size and frame body. - transport_->write(wBuf_.get(), sizeof(sz_nbo)+sz_hbo); + if (sz_hbo > 0) { + // Write size and frame body. + transport_->write(wBuf_.get(), sizeof(sz_nbo)+sz_hbo); + } // Reset our pointers. wBase_ = wBuf_.get(); |