Commit 1233b4b2 authored by Tijl Coosemans's avatar Tijl Coosemans Committed by Alexandre Julliard

ws2_32/tests: Don't wait for FD_CONNECT event when non-blocking connect() was successful.

parent 91f2a4d6
......@@ -650,17 +650,17 @@ static void WINAPI event_client ( client_params *par )
event = WSACreateEvent ();
WSAEventSelect ( mem->s, event, FD_CONNECT );
tmp = connect ( mem->s, (struct sockaddr*) &mem->addr, sizeof ( mem->addr ) );
if ( tmp != 0 && ( err = WSAGetLastError () ) != WSAEWOULDBLOCK )
ok ( 0, "event_client (%x): connect error: %d\n", id, err );
tmp = WaitForSingleObject ( event, INFINITE );
ok ( tmp == WAIT_OBJECT_0, "event_client (%x): wait for connect event failed: %d\n", id, tmp );
err = WSAEnumNetworkEvents ( mem->s, event, &wsa_events );
wsa_ok ( err, 0 ==, "event_client (%x): WSAEnumNetworkEvents error: %d\n" );
err = wsa_events.iErrorCode[ FD_CONNECT_BIT ];
ok ( err == 0, "event_client (%x): connect error: %d\n", id, err );
if ( err ) goto out;
if ( tmp != 0 ) {
err = WSAGetLastError ();
ok ( err == WSAEWOULDBLOCK, "event_client (%x): connect error: %d\n", id, err );
tmp = WaitForSingleObject ( event, INFINITE );
ok ( tmp == WAIT_OBJECT_0, "event_client (%x): wait for connect event failed: %d\n", id, tmp );
err = WSAEnumNetworkEvents ( mem->s, event, &wsa_events );
wsa_ok ( err, 0 ==, "event_client (%x): WSAEnumNetworkEvents error: %d\n" );
err = wsa_events.iErrorCode[ FD_CONNECT_BIT ];
ok ( err == 0, "event_client (%x): connect error: %d\n", id, err );
if ( err ) goto out;
}
trace ( "event_client (%x) connected\n", id );
......
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