1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-05 00:55:04 -05:00

sockfilt: avoid getting stuck waiting for writable socket

Reset FD_WRITE event using the same approach as in multi.c

Follow up to b36442b243
Closes #6992
This commit is contained in:
Marc Hoersken 2021-05-02 20:42:11 +02:00
parent 5a1ec19fda
commit b9239e0f9c
No known key found for this signature in database
GPG Key ID: 61E03CBED7BC859E

View File

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