mirror of
https://github.com/curl/curl.git
synced 2026-08-24 13:03:35 +03:00
sockfilt: handle FD_CLOSE winsock event on write socket
Learn from the way Cygwin handles and maps the WinSock events to simulate correct and complete poll and select behaviour according to Richard W. Stevens Network Programming book. Follow up to #5867 Closes #5879
This commit is contained in:
parent
003e81e2a3
commit
5fcad1c1c6
1 changed files with 3 additions and 3 deletions
|
|
@ -705,7 +705,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
|
||||
if(FD_ISSET(wsasock, writefds)) {
|
||||
FD_SET(wsasock, &writesock);
|
||||
wsaevents.lNetworkEvents |= FD_WRITE|FD_CONNECT;
|
||||
wsaevents.lNetworkEvents |= FD_WRITE|FD_CONNECT|FD_CLOSE;
|
||||
}
|
||||
|
||||
if(FD_ISSET(wsasock, exceptfds)) {
|
||||
|
|
@ -835,11 +835,11 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
FD_CLR(wsasock, readfds);
|
||||
|
||||
/* remove from descriptor set if not ready for write/connect */
|
||||
if(!(wsaevents.lNetworkEvents & (FD_WRITE|FD_CONNECT)))
|
||||
if(!(wsaevents.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE)))
|
||||
FD_CLR(wsasock, writefds);
|
||||
|
||||
/* remove from descriptor set if not exceptional */
|
||||
if(!(wsaevents.lNetworkEvents & (FD_OOB)))
|
||||
if(!(wsaevents.lNetworkEvents & FD_OOB))
|
||||
FD_CLR(wsasock, exceptfds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue