From d5fa2af35300fc6f051d789dd310dad70014cf06 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 21 Jun 2014 14:13:31 +0200 Subject: input/async: use IsEOF() instead of !open for "ready" check Checking "!open" did not work with the NFS plugin because that plugin does not close the file automatically, unlike CURL. --- src/input/AsyncInputStream.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/input') diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index 43190f907..8942b5116 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -175,7 +175,8 @@ AsyncInputStream::ReadTag() bool AsyncInputStream::IsAvailable() { - return postponed_error.IsDefined() || !open || + return postponed_error.IsDefined() || + IsEOF() || !buffer.IsEmpty(); } @@ -191,7 +192,7 @@ AsyncInputStream::Read(void *ptr, size_t read_size, Error &error) return 0; r = buffer.Read(); - if (!r.IsEmpty() || !open) + if (!r.IsEmpty() || IsEOF()) break; cond.wait(mutex); -- cgit v1.2.3