aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_curl.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-06 06:44:19 +0100
committerMax Kellermann <max@duempel.org>2008-11-06 06:44:19 +0100
commite2d7318a184a37e7e1094dc7e783c5b0c61b66c5 (patch)
tree8d268fd14abf05a6e8966e10ce34bae1230ec20c /src/input_curl.c
parenta8e81326d05892fb6b753c518412e73b7cad3ebe (diff)
downloadmpd-e2d7318a184a37e7e1094dc7e783c5b0c61b66c5.tar.gz
mpd-e2d7318a184a37e7e1094dc7e783c5b0c61b66c5.tar.xz
mpd-e2d7318a184a37e7e1094dc7e783c5b0c61b66c5.zip
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.
Diffstat (limited to '')
-rw-r--r--src/input_curl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/input_curl.c b/src/input_curl.c
index 2d563a6eb..fbbe5d461 100644
--- a/src/input_curl.c
+++ b/src/input_curl.c
@@ -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;
}