This commit is contained in:
Glenn Maynard
2006-02-18 02:33:35 +00:00
parent 0f37043af8
commit 34452071c3
@@ -227,19 +227,15 @@ int NetworkStream_Win32::WaitForCompletionOrCancellation( int iEvent )
m_Mutex.Unlock();
/* If the event didn't actually occur, keep waiting. */
if( !(events.lNetworkEvents & (1<<iEvent)) )
{
/* If the socket was closed while we were waiting, stop. Note that when the
* connection closes immediately after sending data, we'll receive both this
* message and FD_READ at the same time. Only do this if the event we really
* want hasn't happened yet. */
if( (events.lNetworkEvents & (1<<FD_CLOSE_BIT)) )
return WSAECONNRESET;
if( (events.lNetworkEvents & (1<<iEvent)) )
return events.iErrorCode[iEvent];
continue;
}
return events.iErrorCode[iEvent];
/* If the socket was closed while we were waiting, stop. Note that when the
* connection closes immediately after sending data, we'll receive both this
* message and FD_READ at the same time. Only do this if the event we really
* want hasn't happened yet. */
if( (events.lNetworkEvents & (1<<FD_CLOSE_BIT)) )
return WSAECONNRESET;
}
}