diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index dcb35fd39..ec59680df 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -187,9 +187,12 @@ AsyncInputStream::Read(std::unique_lock &lock, Check(); r = buffer.Read(); - if (!r.empty() || IsEOF()) + if (!r.empty()) break; + if (IsEOF()) + return 0; + caller_cond.wait(lock); }