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.
This commit is contained in:
Max Kellermann 2008-11-20 12:41:59 +01:00
parent 90bfe65e54
commit f61904db33

View File

@ -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;
}
}
}