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:
Max Kellermann 2008-11-06 06:44:19 +01:00
parent a8e81326d0
commit e2d7318a18

View File

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