* net.cc (wsock_event::wait): Explicitely cancel IO when a signal

arrived to avoid data loss. Fallback to blocking IO when canceling
        fails.
This commit is contained in:
Corinna Vinschen 2001-05-18 08:33:33 +00:00
parent f6b52c79f5
commit 0260054a8c
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Fri May 18 10:31:00 2001 Corinna Vinschen <corinna@vinschen.de>
* net.cc (wsock_event::wait): Explicitely cancel IO when a signal
arrived to avoid data loss. Fallback to blocking IO when canceling
fails.
Thu May 17 15:29:00 2001 Corinna Vinschen <corinna@vinschen.de> Thu May 17 15:29:00 2001 Corinna Vinschen <corinna@vinschen.de>
* security.cc (cygwin_set_impersonation_token): Never destroy * security.cc (cygwin_set_impersonation_token): Never destroy

View File

@ -90,6 +90,12 @@ wsock_event::wait (int socket, LPDWORD flags)
ret = (int) len; ret = (int) len;
break; break;
case WSA_WAIT_EVENT_0 + 1: case WSA_WAIT_EVENT_0 + 1:
if (!CancelIo ((HANDLE)socket))
{
debug_printf ("CancelIo() %E, fallback to blocking io");
WSAGetOverlappedResult(socket, &ovr, &len, TRUE, flags);
}
else
WSASetLastError (WSAEINTR); WSASetLastError (WSAEINTR);
break; break;
case WSA_WAIT_FAILED: case WSA_WAIT_FAILED: