From 70a0a781c8581df7a3b29863ef736aab815bfa4b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 29 Jan 2025 12:58:36 +0100 Subject: [PATCH] input/async: move the IsEOF() check to a separate block --- src/input/AsyncInputStream.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }