multi_wait: stop loop when sread() returns zero

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
Bug: https://curl.haxx.se/mail/archive-2020-02/0011.html
Closes #5019
This commit is contained in:
Daniel Stenberg 2020-03-02 10:38:53 +01:00
parent 0caae3c4be
commit cf7760ab52
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 1 additions and 1 deletions

View File

@ -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;