summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/WSTransceiver.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-11-21 13:18:13 +0100
committerBenoit Foucher <benoit@zeroc.com>2014-11-21 13:18:13 +0100
commit034a455608d892033cd5122f656c30b592db1c87 (patch)
tree658994e8e0af09a173dc02fac891844d598b8230 /cpp/src/Ice/WSTransceiver.cpp
parentUbuntu libdir fixes for bindist (diff)
downloadice-034a455608d892033cd5122f656c30b592db1c87.tar.bz2
ice-034a455608d892033cd5122f656c30b592db1c87.tar.xz
ice-034a455608d892033cd5122f656c30b592db1c87.zip
Fixed ICE-5945: WS transport bug
Diffstat (limited to 'cpp/src/Ice/WSTransceiver.cpp')
-rw-r--r--cpp/src/Ice/WSTransceiver.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp
index 3f5c3a83f43..4bb0fda7ee7 100644
--- a/cpp/src/Ice/WSTransceiver.cpp
+++ b/cpp/src/Ice/WSTransceiver.cpp
@@ -555,6 +555,16 @@ IceInternal::WSTransceiver::read(Buffer& buf, bool& hasMoreData)
}
}
+ //
+ // If we read the full Ice message, handle it before trying
+ // reading anymore data from the WS connection.
+ //
+ if(buf.i == buf.b.end())
+ {
+ hasMoreData |= _readI < _readBuffer.i;
+ return SocketOperationNone;
+ }
+
SocketOperation s = SocketOperationNone;
do
{
@@ -1243,6 +1253,7 @@ IceInternal::WSTransceiver::preRead(Buffer& buf)
throw ProtocolException(__FILE__, __LINE__, "payload length is 0");
}
_readState = ReadStatePayload;
+ assert(buf.i != buf.b.end());
_readFrameStart = buf.i;
break;
}