Commit d5fa2af3 authored by Max Kellermann's avatar Max Kellermann

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.
parent a877926f
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment