[Box Backup-commit] COMMIT r1465 - box/chris/merge/lib/server

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sat Mar 24 21:50:37 GMT 2007


Author: chris
Date: 2007-03-24 21:50:37 +0000 (Sat, 24 Mar 2007)
New Revision: 1465

Modified:
   box/chris/merge/lib/server/WinNamedPipeStream.cpp
Log:
Reinitialise the OVERLAPPED structure each time we start a new overlapped
read. Thanks to Charles Lecklider for pointing this out. (refs #3, merges
part of [1458])


Modified: box/chris/merge/lib/server/WinNamedPipeStream.cpp
===================================================================
--- box/chris/merge/lib/server/WinNamedPipeStream.cpp	2007-03-24 21:42:00 UTC (rev 1464)
+++ box/chris/merge/lib/server/WinNamedPipeStream.cpp	2007-03-24 21:50:37 UTC (rev 1465)
@@ -298,6 +298,13 @@
 		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, 




More information about the Boxbackup-commit mailing list