aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-01-06 12:46:28 +0100
committerMax Kellermann <max@duempel.org>2015-01-06 12:46:28 +0100
commit37e9010887783c307355f3144786ed72e8a973b0 (patch)
treecc360018d22b2ba5ec608b09d464bce134c1fcfd /src/input
parent4bd2c75056271e687e26c4d8038bdefaa7c88dc9 (diff)
downloadmpd-37e9010887783c307355f3144786ed72e8a973b0.tar.gz
mpd-37e9010887783c307355f3144786ed72e8a973b0.tar.xz
mpd-37e9010887783c307355f3144786ed72e8a973b0.zip
input/async: reset the "open" flag after seeking successfully
Fixes a problem with the "curl" input plugin: IsEOF() always returns true because the "open" flag was cleared by CurlInputStream::RequestDone() when end-of-stream was reached. This flag stays false even when seeking to another position has succeeded. This patch resets the "open" flag to true after seeking successfully.
Diffstat (limited to '')
-rw-r--r--src/input/AsyncInputStream.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx
index c8e3fcfd5..5795ecead 100644
--- a/src/input/AsyncInputStream.cxx
+++ b/src/input/AsyncInputStream.cxx
@@ -160,6 +160,11 @@ AsyncInputStream::SeekDone()
assert(io_thread_inside());
assert(IsSeekPending());
+ /* we may have reached end-of-file previously, and the
+ connection may have been closed already; however after
+ seeking successfully, the connection must be alive again */
+ open = true;
+
seek_state = SeekState::NONE;
cond.broadcast();
}