aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <mk@cm4all.com>2008-11-20 12:41:59 +0100
committerMax Kellermann <mk@cm4all.com>2008-11-20 12:41:59 +0100
commitf61904db3324fbb30417e16f9fc69c642ab647e9 (patch)
tree6e771471ad29f1d988c8787df5c6248de7aa7c19
parent90bfe65e54f45351219f48581a927ec52c6a9dd1 (diff)
downloadmpd-f61904db3324fbb30417e16f9fc69c642ab647e9.tar.gz
mpd-f61904db3324fbb30417e16f9fc69c642ab647e9.tar.xz
mpd-f61904db3324fbb30417e16f9fc69c642ab647e9.zip
input_curl: always set eof=true on CURLMSG_DONE
curl_multi_info_read() is the authoritative source of the "end-of-response" information. Always set c->eof when a CURLMSG_DONE message is received, and check the result (success/failure) after that.
-rw-r--r--src/input_curl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/input_curl.c b/src/input_curl.c
index 1d07674e9..06261a7ab 100644
--- a/src/input_curl.c
+++ b/src/input_curl.c
@@ -155,12 +155,14 @@ input_curl_multi_info_read(struct input_stream *is)
while ((msg = curl_multi_info_read(c->multi,
&msgs_in_queue)) != NULL) {
- if (msg->msg == CURLMSG_DONE &&
- msg->data.result != CURLE_OK) {
- g_warning("curl failed: %s\n", c->error);
- is->error = -1;
+ if (msg->msg == CURLMSG_DONE) {
c->eof = true;
- return false;
+
+ if (msg->data.result != CURLE_OK) {
+ g_warning("curl failed: %s\n", c->error);
+ is->error = -1;
+ return false;
+ }
}
}