summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/server/WinNamedPipeStream.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/server/WinNamedPipeStream.cpp b/lib/server/WinNamedPipeStream.cpp
index e4a675a7..6ef174c8 100644
--- a/lib/server/WinNamedPipeStream.cpp
+++ b/lib/server/WinNamedPipeStream.cpp
@@ -298,6 +298,13 @@ int WinNamedPipeStream::Read(void *pBuffer, int NBytes, int Timeout)
mBytesInBuffer = BytesRemaining;
NumBytesRead = BytesToCopy;
+ if (needAnotherRead)
+ {
+ // reinitialise the OVERLAPPED structure
+ memset(&mReadOverlap, 0, sizeof(mReadOverlap));
+ mReadOverlap.hEvent = mReadableEvent;
+ }
+
// start the next overlapped read
if (needAnotherRead && !ReadFile(mSocketHandle,
mReadBuffer + mBytesInBuffer,