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,
|
||||
&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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user