Commit f61904db authored by Max Kellermann's avatar Max Kellermann

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.
parent 90bfe65e
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment