server: Fix connect failures on newer kernels.
This commit is contained in:
parent
a6de06aa4c
commit
f58c709b5f
|
@ -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: "
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue