input_curl: return 0 on error from read()
The read() method must not return a negative value. Make it return 0 on error, just like the file input stream. Also set the "error" attribute to -1.
This commit is contained in:
parent
a8e81326d0
commit
e2d7318a18
@ -156,6 +156,7 @@ input_curl_multi_info_read(struct input_stream *is)
|
||||
msg->data.result != CURLE_OK) {
|
||||
g_warning("curl failed: %s\n",
|
||||
curl_easy_strerror(msg->data.result));
|
||||
is->error = -1;
|
||||
c->eof = true;
|
||||
return false;
|
||||
}
|
||||
@ -262,7 +263,7 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size)
|
||||
|
||||
bret = input_curl_multi_info_read(is);
|
||||
if (!bret)
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
c->eof = running_handles == 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user