From f61904db3324fbb30417e16f9fc69c642ab647e9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 20 Nov 2008 12:41:59 +0100 Subject: 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. --- src/input_curl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/input_curl.c') 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; + } } } -- cgit v1.2.3