diff options
author | Max Kellermann <max@duempel.org> | 2014-06-21 14:13:31 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-06-21 14:13:31 +0200 |
commit | d5fa2af35300fc6f051d789dd310dad70014cf06 (patch) | |
tree | 6220f43afcb54e02ff47e77f31d152302bbfef81 /src/input | |
parent | a877926f087aa86ef90bb8b194f6f8e620fff568 (diff) |
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.
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/AsyncInputStream.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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); |