summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/StreamSocket.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-08-11 18:43:28 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-08-11 18:43:28 +0200
commitd6c5a5a52310ea05205a599709990bf6bee0499a (patch)
treeb18147eb215de7484e97fb5afe789cbf3ec95110 /cpp/src/Ice/StreamSocket.cpp
parentAdd SDK prefix to WinRT builds (diff)
downloadice-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/StreamSocket.cpp')
-rw-r--r--cpp/src/Ice/StreamSocket.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/Ice/StreamSocket.cpp b/cpp/src/Ice/StreamSocket.cpp
index 7ade8172ba4..8eb3a23daf9 100644
--- a/cpp/src/Ice/StreamSocket.cpp
+++ b/cpp/src/Ice/StreamSocket.cpp
@@ -105,7 +105,7 @@ StreamSocket::connect(Buffer& readBuffer, Buffer& writeBuffer)
bool
StreamSocket::isConnected()
{
- return _state == StateConnected;
+ return _state == StateConnected && _fd != INVALID_SOCKET;
}
size_t
@@ -377,7 +377,7 @@ StreamSocket::startWrite(Buffer& buf)
void
StreamSocket::finishWrite(Buffer& buf)
{
- if(_state < StateConnected && _state != StateProxyWrite)
+ if(_fd == INVALID_SOCKET || (_state < StateConnected && _state != StateProxyWrite))
{
return;
}
@@ -439,6 +439,11 @@ StreamSocket::startRead(Buffer& buf)
void
StreamSocket::finishRead(Buffer& buf)
{
+ if(_fd == INVALID_SOCKET)
+ {
+ return;
+ }
+
if(static_cast<int>(_read.count) == SOCKET_ERROR)
{
WSASetLastError(_read.error);