server: Clear the connection error after a successful connection.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-07-06 23:48:41 -05:00 committed by Alexandre Julliard
parent 53ec99daeb
commit ddb9223915
2 changed files with 4 additions and 1 deletions

View File

@ -3344,7 +3344,7 @@ static void test_select(void)
id = 0xdeadbeef;
ret = getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char *)&id, &len);
ok(!ret, "getsockopt failed with %d\n", WSAGetLastError());
todo_wine ok(!id, "got error %u\n", id);
ok(!id, "got error %u\n", id);
closesocket(fdWrite);

View File

@ -983,7 +983,10 @@ static void sock_dispatch_events( struct sock *sock, enum connection_state prevs
case SOCK_CONNECTING:
if (event & POLLOUT)
{
post_socket_event( sock, AFD_POLL_BIT_CONNECT, 0 );
sock->errors[AFD_POLL_BIT_CONNECT_ERR] = 0;
}
if (event & (POLLERR | POLLHUP))
post_socket_event( sock, AFD_POLL_BIT_CONNECT_ERR, error );
break;