From: Marc Hoersken Date: Sun, 2 May 2021 18:42:11 +0000 (+0200) Subject: sockfilt: avoid getting stuck waiting for writable socket X-Git-Tag: curl-7_77_0~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9239e0f9ce64479b7e77472196c958aa388ae7e;p=thirdparty%2Fcurl.git sockfilt: avoid getting stuck waiting for writable socket Reset FD_WRITE event using the same approach as in multi.c Follow up to b36442b24305f3cda7c13cc64b46838995a4985b Closes #6992 --- diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index e29e118714..7009b2585b 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -741,6 +741,9 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, else { wsaevent = WSACreateEvent(); if(wsaevent != WSA_INVALID_EVENT) { + if(wsaevents.lNetworkEvents & FD_WRITE) { + send(wsasock, NULL, 0, 0); /* reset FD_WRITE */ + } error = WSAEventSelect(wsasock, wsaevent, wsaevents.lNetworkEvents); if(error != SOCKET_ERROR) { handles[nfd] = (HANDLE)wsaevent;