server: Fix connect failures on newer kernels.

This commit is contained in:
Mike Kaplinskiy 2011-01-24 00:21:15 -05:00 committed by Alexandre Julliard
parent a6de06aa4c
commit f58c709b5f
2 changed files with 9 additions and 9 deletions

View File

@ -4026,7 +4026,7 @@ static void test_ConnectEx(void)
closesocket(listener); closesocket(listener);
listener = INVALID_SOCKET; listener = INVALID_SOCKET;
address.sin_port = 1; address.sin_port = htons(1);
bret = pConnectEx(connector, (struct sockaddr*)&address, addrlen, NULL, 0, &bytesReturned, &overlapped); bret = pConnectEx(connector, (struct sockaddr*)&address, addrlen, NULL, 0, &bytesReturned, &overlapped);
ok(bret == FALSE && GetLastError(), "ConnectEx to bad destination failed: " ok(bret == FALSE && GetLastError(), "ConnectEx to bad destination failed: "

View File

@ -388,19 +388,19 @@ static void sock_poll_event( struct fd *fd, int event )
if (sock->state & FD_CONNECT) if (sock->state & FD_CONNECT)
{ {
/* connecting */ if (event & (POLLERR|POLLHUP))
if (event & POLLOUT) {
/* we didn't get connected? */
sock->state &= ~FD_CONNECT;
event &= ~POLLOUT;
error = sock_error( fd );
}
else if (event & POLLOUT)
{ {
/* we got connected */ /* we got connected */
sock->state |= FD_WINE_CONNECTED|FD_READ|FD_WRITE; sock->state |= FD_WINE_CONNECTED|FD_READ|FD_WRITE;
sock->state &= ~FD_CONNECT; sock->state &= ~FD_CONNECT;
} }
else if (event & (POLLERR|POLLHUP))
{
/* we didn't get connected? */
sock->state &= ~FD_CONNECT;
error = sock_error( fd );
}
} }
else if (sock->state & FD_WINE_LISTENING) else if (sock->state & FD_WINE_LISTENING)
{ {