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=51442
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-01-06 17:26:43 -06:00 committed by Alexandre Julliard
parent 7c037c82c8
commit 51e5995d47
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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;