Commit 9dccb294 authored by Martin Wilck's avatar Martin Wilck Committed by Alexandre Julliard

WS2_register_async_shutdown(): Try immediate completion, in case an

app never waits for anything. WS_accept(): Avoid crash if addr parameter is NULL.
parent 40681ff2
...@@ -1371,7 +1371,12 @@ static int WS2_register_async_shutdown ( SOCKET s, int fd, int type ) ...@@ -1371,7 +1371,12 @@ static int WS2_register_async_shutdown ( SOCKET s, int fd, int type )
ws2_async_cleanup ( &wsa->async ); ws2_async_cleanup ( &wsa->async );
goto out; goto out;
} }
/* Try immediate completion */
if ( WSAGetOverlappedResult ( (HANDLE) s, ovl, NULL, FALSE, NULL ) )
return 0;
if ( (err = WSAGetLastError ()) == WSA_IO_INCOMPLETE )
return 0; return 0;
return WSAEINVAL;
out_close: out_close:
WSACloseEvent ( ovl->hEvent ); WSACloseEvent ( ovl->hEvent );
...@@ -1414,6 +1419,7 @@ SOCKET WINAPI WS_accept(SOCKET s, struct WS_sockaddr *addr, ...@@ -1414,6 +1419,7 @@ SOCKET WINAPI WS_accept(SOCKET s, struct WS_sockaddr *addr,
SERVER_END_REQ; SERVER_END_REQ;
if (as) if (as)
{ {
if (addr)
WS_getpeername(as, addr, addrlen32); WS_getpeername(as, addr, addrlen32);
return as; return as;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment