diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-08-11 18:43:28 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-08-11 18:43:28 +0200 |
commit | d6c5a5a52310ea05205a599709990bf6bee0499a (patch) | |
tree | b18147eb215de7484e97fb5afe789cbf3ec95110 /cpp/src/Ice/WSTransceiver.cpp | |
parent | Add SDK prefix to WinRT builds (diff) | |
download | ice-d6c5a5a52310ea05205a599709990bf6bee0499a.tar.bz2 ice-d6c5a5a52310ea05205a599709990bf6bee0499a.tar.xz ice-d6c5a5a52310ea05205a599709990bf6bee0499a.zip |
Fixed ICE-6695 - ensure buffers are not cleared too early for WS/SSL transports
Diffstat (limited to 'cpp/src/Ice/WSTransceiver.cpp')
-rw-r--r-- | cpp/src/Ice/WSTransceiver.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index a7f85a0e8bd..e68bccc4668 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -482,8 +482,14 @@ IceInternal::WSTransceiver::close() // // Clear the buffers now instead of waiting for destruction. // - _writeBuffer.b.clear(); - _readBuffer.b.clear(); + if(!_writePending) + { + _writeBuffer.b.clear(); + } + if(!_readPending) + { + _readBuffer.b.clear(); + } } SocketOperation @@ -677,6 +683,7 @@ void IceInternal::WSTransceiver::finishWrite(Buffer& buf) { _writePending = false; + if(_state < StateOpened) { if(_state < StateConnected) @@ -700,6 +707,12 @@ IceInternal::WSTransceiver::finishWrite(Buffer& buf) _delegate->finishWrite(buf); } + if(_state == StateClosed) + { + _writeBuffer.b.clear(); + return; + } + postWrite(buf); } @@ -782,6 +795,13 @@ IceInternal::WSTransceiver::finishRead(Buffer& buf, bool& hasMoreData) { _delegate->finishRead(_readBuffer, hasMoreData); } + + if(_state == StateClosed) + { + _readBuffer.b.clear(); + return; + } + postRead(buf); } #endif |