[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 49/411: multi: handle connection state winsock events
From: |
gnunet |
Subject: |
[gnurl] 49/411: multi: handle connection state winsock events |
Date: |
Wed, 13 Jan 2021 01:17:44 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 003e81e2a3d2e72c2319ef9bd285141fe02e0b26
Author: Marc Hoersken <info@marc-hoersken.de>
AuthorDate: Wed Aug 26 22:13:21 2020 +0200
multi: handle connection state winsock events
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.
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Follow up to #5634
Closes #5867
---
lib/multi.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/multi.c b/lib/multi.c
index f4448f7c4..2a9124648 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1184,7 +1184,7 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi,
#ifdef USE_WINSOCK
if(SOCKET_READABLE(sockbunch[i], 0) > 0)
timeout_ms = 0;
- mask |= FD_READ;
+ mask |= (FD_READ|FD_ACCEPT|FD_CLOSE);
#else
ufds[nfds].fd = sockbunch[i];
ufds[nfds].events = POLLIN;
@@ -1196,7 +1196,7 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi,
#ifdef USE_WINSOCK
if(SOCKET_WRITABLE(sockbunch[i], 0) > 0)
timeout_ms = 0;
- mask |= FD_WRITE;
+ mask |= (FD_WRITE|FD_CONNECT|FD_CLOSE);
#else
ufds[nfds].fd = sockbunch[i];
ufds[nfds].events = POLLOUT;
@@ -1226,7 +1226,7 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi,
pre_poll.events = 0;
pre_poll.revents = 0;
if(extra_fds[i].events & CURL_WAIT_POLLIN) {
- events |= FD_READ;
+ events |= (FD_READ|FD_ACCEPT|FD_CLOSE);
pre_poll.events |= POLLIN;
}
if(extra_fds[i].events & CURL_WAIT_POLLPRI) {
@@ -1234,7 +1234,7 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi,
pre_poll.events |= POLLPRI;
}
if(extra_fds[i].events & CURL_WAIT_POLLOUT) {
- events |= FD_WRITE;
+ events |= (FD_WRITE|FD_CONNECT|FD_CLOSE);
pre_poll.events |= POLLOUT;
}
if(Curl_poll(&pre_poll, 1, 0) > 0) {
@@ -1299,9 +1299,9 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi,
mask = extra_fds[i].revents;
if(WSAEnumNetworkEvents(extra_fds[i].fd, multi->wsa_event,
&events) == 0) {
- if(events.lNetworkEvents & FD_READ)
+ if(events.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE))
mask |= CURL_WAIT_POLLIN;
- if(events.lNetworkEvents & FD_WRITE)
+ if(events.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE))
mask |= CURL_WAIT_POLLOUT;
if(events.lNetworkEvents & FD_OOB)
mask |= CURL_WAIT_POLLPRI;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 27/411: winbuild: convert the instruction text to README.md, (continued)
- [gnurl] 27/411: winbuild: convert the instruction text to README.md, gnunet, 2021/01/12
- [gnurl] 15/411: checksrc: verify do-while and spaces between the braces, gnunet, 2021/01/12
- [gnurl] 59/411: docs: add description about CI platforms to CONTRIBUTE.md, gnunet, 2021/01/12
- [gnurl] 67/411: curl.1: add see also no-progress-meter on two spots, gnunet, 2021/01/12
- [gnurl] 41/411: docs/libcurl: update "Added in" version for curl_easy_option*, gnunet, 2021/01/12
- [gnurl] 35/411: openssl: Fix wincrypt symbols conflict with BoringSSL, gnunet, 2021/01/12
- [gnurl] 18/411: configure: fix pkg-config detecting wolfssl, gnunet, 2021/01/12
- [gnurl] 32/411: schannel: fix memory leak when using get_cert_location, gnunet, 2021/01/12
- [gnurl] 10/411: CURLE_PROXY: new error code, gnunet, 2021/01/12
- [gnurl] 43/411: buildconf: invoke 'autoreconf -fi' instead, gnunet, 2021/01/12
- [gnurl] 49/411: multi: handle connection state winsock events,
gnunet <=
- [gnurl] 57/411: ntlm: fix condition for curl_ntlm_core usage, gnunet, 2021/01/12
- [gnurl] 68/411: cmdline-opts/gen.pl: generate nicer "See Also" in curl.1, gnunet, 2021/01/12
- [gnurl] 42/411: lib: make Curl_gethostname accept a const pointer, gnunet, 2021/01/12
- [gnurl] 66/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 39/411: configure: added --disable-get-easy-options, gnunet, 2021/01/12
- [gnurl] 53/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 65/411: mqtt: enable by default, gnunet, 2021/01/12
- [gnurl] 58/411: tests/getpart: use MIME::Base64 instead of home-cooked, gnunet, 2021/01/12
- [gnurl] 63/411: url: remove funny embedded comments in Curl_disonnect calls, gnunet, 2021/01/12
- [gnurl] 46/411: docs: SSLCERTS: fix English syntax, gnunet, 2021/01/12