input_curl: set "ready" flag on EOF

Set the "ready" flag for empty resources.
This commit is contained in:
Max Kellermann 2009-01-15 16:12:22 +01:00
parent fa3899f7b0
commit f1790fc8bf
2 changed files with 6 additions and 0 deletions

1
NEWS
View File

@ -27,6 +27,7 @@ MPD 0.14.1 - not yet released
- use select() to eliminate busy loop during connect - use select() to eliminate busy loop during connect
- honour http_proxy_* config directives - honour http_proxy_* config directives
- fix assertion failure on "connection refused" - fix assertion failure on "connection refused"
- fix assertion failure with empty HTTP responses
* log: automatically append newline * log: automatically append newline
* fix setenv() conflict on Solaris * fix setenv() conflict on Solaris
* configure.ac: check for pkg-config before using it * configure.ac: check for pkg-config before using it

View File

@ -194,6 +194,7 @@ input_curl_multi_info_read(struct input_stream *is)
&msgs_in_queue)) != NULL) { &msgs_in_queue)) != NULL) {
if (msg->msg == CURLMSG_DONE) { if (msg->msg == CURLMSG_DONE) {
c->eof = true; c->eof = true;
is->ready = true;
if (msg->data.result != CURLE_OK) { if (msg->data.result != CURLE_OK) {
g_warning("curl failed: %s\n", c->error); 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", g_warning("curl_multi_perform() failed: %s\n",
curl_multi_strerror(mcode)); curl_multi_strerror(mcode));
c->eof = true; c->eof = true;
is->ready = true;
return 0; return 0;
} }
@ -491,6 +493,7 @@ input_curl_buffer(struct input_stream *is)
g_warning("curl_multi_perform() failed: %s\n", g_warning("curl_multi_perform() failed: %s\n",
curl_multi_strerror(mcode)); curl_multi_strerror(mcode));
c->eof = true; c->eof = true;
is->ready = true;
return -1; return -1;
} }
@ -784,6 +787,8 @@ input_curl_seek(struct input_stream *is, off_t offset, int whence)
struct input_curl *c = is->data; struct input_curl *c = is->data;
bool ret; bool ret;
assert(is->ready);
if (whence == SEEK_SET && offset == 0) { if (whence == SEEK_SET && offset == 0) {
if (is->offset == 0) if (is->offset == 0)
/* no-op */ /* no-op */