diff options
author | Max Kellermann <max@duempel.org> | 2009-01-15 16:12:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-15 16:12:22 +0100 |
commit | a9cfa6023f6c8991aac622d1f51619922cf4ed02 (patch) | |
tree | 21e6a3929c534a41b65e998145518daf4cb71b4f | |
parent | d080677b15df42e3d61aa15e3319cfb099a060a2 (diff) | |
download | mpd-a9cfa6023f6c8991aac622d1f51619922cf4ed02.tar.gz mpd-a9cfa6023f6c8991aac622d1f51619922cf4ed02.tar.xz mpd-a9cfa6023f6c8991aac622d1f51619922cf4ed02.zip |
input_curl: set "ready" flag on EOF
Set the "ready" flag for empty resources.
Diffstat (limited to '')
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/input_curl.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -11,6 +11,7 @@ MPD 0.14.1 - not yet released - use select() to eliminate busy loop during connect - honour http_proxy_* config directives - fix assertion failure on "connection refused" + - fix assertion failure with empty HTTP responses * log: automatically append newline * fix setenv() conflict on Solaris * configure.ac: check for pkg-config before using it diff --git a/src/input_curl.c b/src/input_curl.c index 9eac5c360..dd74ed59e 100644 --- a/src/input_curl.c +++ b/src/input_curl.c @@ -158,6 +158,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); @@ -277,6 +278,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; } @@ -359,6 +361,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; } @@ -606,6 +609,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 */ |