summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-08-28 22:30:39 +0200
committerMarc Hoersken <info@marc-hoersken.de>2020-08-28 22:30:39 +0200
commit5fcad1c1c6b5301870b2a21f070e86f1a797b624 (patch)
tree7170ed61ac645a5c47bd709bab229b0945c43fcf
parent003e81e2a3d2e72c2319ef9bd285141fe02e0b26 (diff)
downloadcurl-5fcad1c1c6b5301870b2a21f070e86f1a797b624.tar.gz
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
-rw-r--r--tests/server/sockfilt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 6b3758c94..f5281817d 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -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);
}
}