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.
This commit is contained in:
Max Kellermann 2014-06-21 14:13:31 +02:00
parent a877926f08
commit d5fa2af353

View File

@ -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);