summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-03-02 10:38:53 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-03-02 10:38:53 +0100
commit8c14d24ea307739114ede78b1ddcc96efb0e7c6f (patch)
tree83b9b86c37b606e35ff5c323677a3283b6a2c64b
parent967bf4633ab164fc0da1876428af9386f18659af (diff)
downloadcurl-bagder/multi-wait-sread.tar.gz
multi_wait: stop loop when sread() returns zerobagder/multi-wait-sread
It's unclear why it would ever return zero here, but this change fixes Robert's problem and it shouldn't loop forever... Reported-by: Robert Dunaj Buf: https://curl.haxx.se/mail/archive-2020-02/0011.html
-rw-r--r--lib/multi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c
index ef86f7c22..cef2805c8 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1199,7 +1199,7 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi,
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) {
+ if(sread(multi->wakeup_pair[0], buf, sizeof(buf)) <= 0) {
#ifndef USE_WINSOCK
if(EINTR == SOCKERRNO)
continue;