[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 246/282: multi: skip EINTR check on wakeup socket if it was clos
From: |
gnunet |
Subject: |
[gnurl] 246/282: multi: skip EINTR check on wakeup socket if it was closed |
Date: |
Wed, 01 Apr 2020 14:31:51 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 2258b7bcc265b5fe9bfa79ddd079f57e61557da7
Author: Jay Satiro <address@hidden>
AuthorDate: Thu Mar 5 23:35:32 2020 -0500
multi: skip EINTR check on wakeup socket if it was closed
- Don't check errno on wakeup socket if sread returned 0 since sread
doesn't set errno in that case.
This is a follow-up to cf7760a from several days ago which fixed
Curl_multi_wait to stop busy looping sread on the non-blocking wakeup
socket if it was closed (ie sread returns 0). Due to a logic error it
was still possible to busy loop in that case if errno == EINTR.
Closes https://github.com/curl/curl/pull/5047
---
lib/multi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/multi.c b/lib/multi.c
index cef2805c8..e10e75293 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1194,14 +1194,16 @@ static CURLMcode Curl_multi_wait(struct Curl_multi
*multi,
if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) {
if(ufds[curlfds + extra_nfds].revents & POLLIN) {
char buf[64];
+ ssize_t nread;
while(1) {
/* the reading socket is non-blocking, try to read
data from it until it receives an error (except EINTR).
In normal cases it will get EAGAIN or EWOULDBLOCK
when there is no more data, breaking the loop. */
- if(sread(multi->wakeup_pair[0], buf, sizeof(buf)) <= 0) {
+ nread = sread(multi->wakeup_pair[0], buf, sizeof(buf));
+ if(nread <= 0) {
#ifndef USE_WINSOCK
- if(EINTR == SOCKERRNO)
+ if(nread < 0 && EINTR == SOCKERRNO)
continue;
#endif
break;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 256/282: tool_cb_see: set correct copyright year range, (continued)
- [gnurl] 256/282: tool_cb_see: set correct copyright year range, gnunet, 2020/04/01
- [gnurl] 254/282: config-win32: Windows does not have ftruncate, gnunet, 2020/04/01
- [gnurl] 262/282: runtests: fix missing use of exe_ext helper function, gnunet, 2020/04/01
- [gnurl] 261/282: ares: store dns parameters for duphandle, gnunet, 2020/04/01
- [gnurl] 266/282: lib1564: reduce number of mid-wait wakeup calls, gnunet, 2020/04/01
- [gnurl] 260/282: version: make curl_version* thread-safe without using global context, gnunet, 2020/04/01
- [gnurl] 269/282: test 1560: avoid valgrind false positives, gnunet, 2020/04/01
- [gnurl] 271/282: silly web server: silent a compilation warning, gnunet, 2020/04/01
- [gnurl] 272/282: socks4: fix host resolve regression, gnunet, 2020/04/01
- [gnurl] 263/282: mime: latch last read callback status., gnunet, 2020/04/01
- [gnurl] 246/282: multi: skip EINTR check on wakeup socket if it was closed,
gnunet <=
- [gnurl] 253/282: pause: force a connection (re-)check after unpausing, gnunet, 2020/04/01
- [gnurl] 273/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 267/282: sha256: Added SecureTransport implementation, gnunet, 2020/04/01
- [gnurl] 265/282: mime: fix the binary encoder to handle large data properly, gnunet, 2020/04/01
- [gnurl] 275/282: runtests: log minimal and maximal used port numbers, gnunet, 2020/04/01
- [gnurl] 279/282: test1129: fix invalid case of closing XML-tag and Content-Length, gnunet, 2020/04/01
- [gnurl] 274/282: sftp: fix segfault regression introduced by #4747, gnunet, 2020/04/01
- [gnurl] 277/282: tests/data: fix static ip:port instead of dynamic values being used, gnunet, 2020/04/01
- [gnurl] 281/282: RELEASE-NOTES: 7.69.1, gnunet, 2020/04/01
- [gnurl] 270/282: cookie: get_top_domain() sets zero length for null domains, gnunet, 2020/04/01