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:
parent
90bfe65e54
commit
f61904db33
@ -155,12 +155,14 @@ input_curl_multi_info_read(struct input_stream *is)
|
|||||||
|
|
||||||
while ((msg = curl_multi_info_read(c->multi,
|
while ((msg = curl_multi_info_read(c->multi,
|
||||||
&msgs_in_queue)) != NULL) {
|
&msgs_in_queue)) != NULL) {
|
||||||
if (msg->msg == CURLMSG_DONE &&
|
if (msg->msg == CURLMSG_DONE) {
|
||||||
msg->data.result != CURLE_OK) {
|
|
||||||
g_warning("curl failed: %s\n", c->error);
|
|
||||||
is->error = -1;
|
|
||||||
c->eof = true;
|
c->eof = true;
|
||||||
return false;
|
|
||||||
|
if (msg->data.result != CURLE_OK) {
|
||||||
|
g_warning("curl failed: %s\n", c->error);
|
||||||
|
is->error = -1;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user