aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-06-21 14:13:31 +0200
committerMax Kellermann <max@duempel.org>2014-06-21 14:13:31 +0200
commitd5fa2af35300fc6f051d789dd310dad70014cf06 (patch)
tree6220f43afcb54e02ff47e77f31d152302bbfef81
parenta877926f087aa86ef90bb8b194f6f8e620fff568 (diff)
downloadmpd-d5fa2af35300fc6f051d789dd310dad70014cf06.tar.gz
mpd-d5fa2af35300fc6f051d789dd310dad70014cf06.tar.xz
mpd-d5fa2af35300fc6f051d789dd310dad70014cf06.zip
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 '')
-rw-r--r--src/input/AsyncInputStream.cxx5
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);