[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 74/411: select: align poll emulation to return all relevant even
From: |
gnunet |
Subject: |
[gnurl] 74/411: select: align poll emulation to return all relevant events |
Date: |
Wed, 13 Jan 2021 01:18:09 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 20d74b7393d5aedcc9d54c92b8ed56cae473d04e
Author: Marc Hoersken <info@marc-hoersken.de>
AuthorDate: Mon Aug 31 10:49:20 2020 +0200
select: align poll emulation to return all relevant events
The poll emulation via select already consumes POLLRDNORM,
POLLWRNORM and POLLRDBAND as input events. Therefore it
should also return them as output events if signaled.
Also fix indentation in input event handling block.
Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Replaces #5852
Closes #5883
---
lib/select.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/lib/select.c b/lib/select.c
index 5bb6d12cc..917133b72 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -378,7 +378,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds,
timediff_t timeout_ms)
if(ufds[i].revents & POLLHUP)
ufds[i].revents |= POLLIN;
if(ufds[i].revents & POLLERR)
- ufds[i].revents |= (POLLIN|POLLOUT);
+ ufds[i].revents |= POLLIN|POLLOUT;
}
#else /* HAVE_POLL_FINE */
@@ -394,7 +394,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds,
timediff_t timeout_ms)
continue;
VERIFY_SOCK(ufds[i].fd);
if(ufds[i].events & (POLLIN|POLLOUT|POLLPRI|
- POLLRDNORM|POLLWRNORM|POLLRDBAND)) {
+ POLLRDNORM|POLLWRNORM|POLLRDBAND)) {
if(ufds[i].fd > maxfd)
maxfd = ufds[i].fd;
if(ufds[i].events & (POLLRDNORM|POLLIN))
@@ -421,12 +421,24 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds,
timediff_t timeout_ms)
ufds[i].revents = 0;
if(ufds[i].fd == CURL_SOCKET_BAD)
continue;
- if(FD_ISSET(ufds[i].fd, &fds_read))
- ufds[i].revents |= POLLIN;
- if(FD_ISSET(ufds[i].fd, &fds_write))
- ufds[i].revents |= POLLOUT;
- if(FD_ISSET(ufds[i].fd, &fds_err))
- ufds[i].revents |= POLLPRI;
+ if(FD_ISSET(ufds[i].fd, &fds_read)) {
+ if(ufds[i].events & POLLRDNORM)
+ ufds[i].revents |= POLLRDNORM;
+ if(ufds[i].events & POLLIN)
+ ufds[i].revents |= POLLIN;
+ }
+ if(FD_ISSET(ufds[i].fd, &fds_write)) {
+ if(ufds[i].events & POLLWRNORM)
+ ufds[i].revents |= POLLWRNORM;
+ if(ufds[i].events & POLLOUT)
+ ufds[i].revents |= POLLOUT;
+ }
+ if(FD_ISSET(ufds[i].fd, &fds_err)) {
+ if(ufds[i].events & POLLRDBAND)
+ ufds[i].revents |= POLLRDBAND;
+ if(ufds[i].events & POLLPRI)
+ ufds[i].revents |= POLLPRI;
+ }
if(ufds[i].revents != 0)
r++;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 51/411: easyoptions: provide debug function when DEBUGBUILD, (continued)
- [gnurl] 51/411: easyoptions: provide debug function when DEBUGBUILD, gnunet, 2021/01/12
- [gnurl] 36/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 48/411: Curl_pgrsTime - return new time to avoid timeout integer overflow, gnunet, 2021/01/12
- [gnurl] 64/411: tls: add CURLOPT_SSL_EC_CURVES and --curves, gnunet, 2021/01/12
- [gnurl] 86/411: travis: add a CI job with openssl3 (from git master), gnunet, 2021/01/12
- [gnurl] 93/411: docs: add categories to all cmdline opts, gnunet, 2021/01/12
- [gnurl] 98/411: winbuild/rundebug.cmd: remove, gnunet, 2021/01/12
- [gnurl] 84/411: setopt: avoid curl_ on local variable, gnunet, 2021/01/12
- [gnurl] 80/411: curl_threads: make it 'struct Curl_actual_call', gnunet, 2021/01/12
- [gnurl] 103/411: test1541: remove since it is a known bug, gnunet, 2021/01/12
- [gnurl] 74/411: select: align poll emulation to return all relevant events,
gnunet <=
- [gnurl] 110/411: openssl: consider ALERT_CERTIFICATE_EXPIRED a failed verification, gnunet, 2021/01/12
- [gnurl] 81/411: vtls: make it 'struct Curl_ssl_session', gnunet, 2021/01/12
- [gnurl] 85/411: openssl: avoid error conditions when importing native CA, gnunet, 2021/01/12
- [gnurl] 124/411: tests: add test1912 to the dist, gnunet, 2021/01/12
- [gnurl] 91/411: connect.c: remove superfluous 'else' in Curl_getconnectinfo, gnunet, 2021/01/12
- [gnurl] 101/411: curl: retry delays in parallel mode no longer sleeps blocking, gnunet, 2021/01/12
- [gnurl] 106/411: tests/libtests: remove test 1900 and 2033, gnunet, 2021/01/12
- [gnurl] 82/411: wildcard: strip "curl_" prefix from private symbols, gnunet, 2021/01/12
- [gnurl] 73/411: CI/azure: MQTT is now enabled by default, gnunet, 2021/01/12
- [gnurl] 107/411: libtest: remove lib1541 leftovers, gnunet, 2021/01/12