[PATCH] wineserver: avoid spurious FD_WRITE on repeated calls to WSAEventSelect()
Repeated calls to WSAEventSelect() with FD_WRITE deliver spurious FD_WRITE events, as the flag isn't held, resulting in us unnecessarily polling the socket for writability, despite the fact FD_WRITE should only be delivered (1) initially on socket creation, and (2) after send[to]() fails with EWOULDBLOCK and buffer space becomes available. This breaks some applications (possibly #10204 and #24946). This patch prevents the spurious FD_WRITE by always holding FD_WRITE in WSAEventSelect()/set_socket_event(). It will be cleared from hmask in enable_socket_event() when a real FD_WRITE needs to be delivered. Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com> --- dlls/ws2_32/tests/sock.c | 5 ++--- server/sock.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-)
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=62386 Your paranoid android. === debian10 (32 bit French report) === ws2_32: sock.c:3056: Test failed: Test[1]: expected 0, got 2 sock.c:3056: Test failed: Test[2]: expected 0, got 2 sock.c:3056: Test failed: Test[1]: expected 0, got 2 sock.c:3056: Test failed: Test[2]: expected 0, got 2 === debian10 (32 bit Japanese:Japan report) === ws2_32: sock.c:3051: Test failed: Test[1]: expected 2, got 0 sock.c:3056: Test failed: Test[1]: expected 0, got 2 sock.c:3051: Test failed: Test[2]: expected 2, got 0 sock.c:3056: Test failed: Test[2]: expected 0, got 2 sock.c:3051: Test failed: Test[1]: expected 2, got 0 sock.c:3056: Test failed: Test[1]: expected 0, got 2 sock.c:3051: Test failed: Test[2]: expected 2, got 0 sock.c:3056: Test failed: Test[2]: expected 0, got 2
participants (2)
-
Damjan Jovanovic -
Marvin