diff options
author | Max Kellermann <max@duempel.org> | 2008-11-06 06:44:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-06 06:44:19 +0100 |
commit | e2d7318a184a37e7e1094dc7e783c5b0c61b66c5 (patch) | |
tree | 8d268fd14abf05a6e8966e10ce34bae1230ec20c | |
parent | a8e81326d05892fb6b753c518412e73b7cad3ebe (diff) | |
download | mpd-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.
-rw-r--r-- | src/input_curl.c | 3 |
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; } |