diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index e3ea91d..0f0e7ab 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -501,6 +501,7 @@ IceInternal::AsyncInfo::AsyncInfo(SocketOperation s) { ZeroMemory(this, sizeof(AsyncInfo)); status = s; + count = 0; } #endif diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp index bbaba2b..9036559 100644 --- a/cpp/src/Ice/TcpTransceiver.cpp +++ b/cpp/src/Ice/TcpTransceiver.cpp @@ -301,6 +301,7 @@ IceInternal::TcpTransceiver::startWrite(Buffer& buf) packetSize = _maxSendPacketSize; } + assert(_write.count == 0); _write.buf.len = packetSize; _write.buf.buf = reinterpret_cast(&*buf.i); int err = WSASend(_fd, &_write.buf, 1, &_write.count, 0, &_write, NULL); @@ -367,6 +368,7 @@ IceInternal::TcpTransceiver::finishWrite(Buffer& buf) } buf.i += _write.count; + _write.count = 0; } void @@ -380,6 +382,7 @@ IceInternal::TcpTransceiver::startRead(Buffer& buf) assert(!buf.b.empty() && buf.i != buf.b.end()); + assert(_read.count == 0); _read.buf.len = packetSize; _read.buf.buf = reinterpret_cast(&*buf.i); int err = WSARecv(_fd, &_read.buf, 1, &_read.count, &_read.flags, &_read, NULL); @@ -446,6 +449,7 @@ IceInternal::TcpTransceiver::finishRead(Buffer& buf) } buf.i += _read.count; + _read.count = 0; } #endif