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);
listener = INVALID_SOCKET;
address.sin_port = 1;
address.sin_port = htons(1);
bret = pConnectEx(connector, (struct sockaddr*)&address, addrlen, NULL, 0, &bytesReturned, &overlapped);
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)
{
/* connecting */
if (event & POLLOUT)
if (event & (POLLERR|POLLHUP))
{
/* we didn't get connected? */
sock->state &= ~FD_CONNECT;
event &= ~POLLOUT;
error = sock_error( fd );
}
else if (event & POLLOUT)
{
/* we got connected */
sock->state |= FD_WINE_CONNECTED|FD_READ|FD_WRITE;
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)
{