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
Родитель 0caae3c4be
Коммит cf7760ab52
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

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