Commit 51e5995d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Avoid reporting POLLOUT on connection failure in poll_single_socket().

Ideally we should be using sock_get_poll_events() and sock_poll_event() instead, but that seems like an overly risky change for this late in code freeze. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51442Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7c037c82
......@@ -6830,7 +6830,7 @@ static void test_WSAPoll(void)
fds[0].events = POLLRDNORM | POLLRDBAND | POLLWRNORM;
fds[0].revents = 0xdead;
ret = pWSAPoll(fds, 1, 10000);
todo_wine ok(ret == 1, "got %d\n", ret);
ok(ret == 1, "got %d\n", ret);
todo_wine ok(fds[0].revents == (POLLWRNORM | POLLHUP | POLLERR), "got events %#x\n", fds[0].revents);
len = sizeof(err);
......
......@@ -2979,6 +2979,9 @@ static int poll_single_socket( struct sock *sock, int mask )
if (pollfd.events < 0 || poll( &pollfd, 1, 0 ) < 0)
return 0;
if (sock->state == SOCK_CONNECTING && (pollfd.revents & (POLLERR | POLLHUP)))
pollfd.revents &= ~POLLOUT;
if ((mask & AFD_POLL_HUP) && (pollfd.revents & POLLIN) && sock->type == WS_SOCK_STREAM)
{
char dummy;
......
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