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@gmail.com --- dlls/ws2_32/tests/sock.c | 5 ++--- server/sock.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-)