aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-15 16:12:22 +0100
committerMax Kellermann <max@duempel.org>2009-01-15 16:16:55 +0100
commitf1790fc8bf1fe46f977b6ecad0e1cd03b7edde82 (patch)
treed5001bc451f68810949ebd0b9a3a6603198f250c /src
parentfa3899f7b0e6c3250f3cb38ac4f9a07d0ab80874 (diff)
downloadmpd-f1790fc8bf1fe46f977b6ecad0e1cd03b7edde82.tar.gz
mpd-f1790fc8bf1fe46f977b6ecad0e1cd03b7edde82.tar.xz
mpd-f1790fc8bf1fe46f977b6ecad0e1cd03b7edde82.zip
input_curl: set "ready" flag on EOF
Set the "ready" flag for empty resources.
Diffstat (limited to '')
-rw-r--r--src/input_curl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input_curl.c b/src/input_curl.c
index 8372f9924..afa85eb36 100644
--- a/src/input_curl.c
+++ b/src/input_curl.c
@@ -194,6 +194,7 @@ input_curl_multi_info_read(struct input_stream *is)
&msgs_in_queue)) != NULL) {
if (msg->msg == CURLMSG_DONE) {
c->eof = true;
+ is->ready = true;
if (msg->data.result != CURLE_OK) {
g_warning("curl failed: %s\n", c->error);
@@ -389,6 +390,7 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size)
g_warning("curl_multi_perform() failed: %s\n",
curl_multi_strerror(mcode));
c->eof = true;
+ is->ready = true;
return 0;
}
@@ -491,6 +493,7 @@ input_curl_buffer(struct input_stream *is)
g_warning("curl_multi_perform() failed: %s\n",
curl_multi_strerror(mcode));
c->eof = true;
+ is->ready = true;
return -1;
}
@@ -784,6 +787,8 @@ input_curl_seek(struct input_stream *is, off_t offset, int whence)
struct input_curl *c = is->data;
bool ret;
+ assert(is->ready);
+
if (whence == SEEK_SET && offset == 0) {
if (is->offset == 0)
/* no-op */