aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist/pls_playlist_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-14 23:53:04 +0100
committerMax Kellermann <max@duempel.org>2009-12-15 23:12:11 +0100
commit228b03edf8513aa1cdaf4e4647279cc580245555 (patch)
tree7f5b03a9727fb8c371885469296eb7f49f6fa68b /src/playlist/pls_playlist_plugin.c
parentd000d31355c824a076324b647a3f056aab9ddabe (diff)
downloadmpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.gz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.xz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.zip
input_stream: return errors with GError
Diffstat (limited to 'src/playlist/pls_playlist_plugin.c')
-rw-r--r--src/playlist/pls_playlist_plugin.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/playlist/pls_playlist_plugin.c b/src/playlist/pls_playlist_plugin.c
index 5308b7160..30c62b76e 100644
--- a/src/playlist/pls_playlist_plugin.c
+++ b/src/playlist/pls_playlist_plugin.c
@@ -115,9 +115,18 @@ pls_open_stream(struct input_stream *is)
GString *kf_data = g_string_new("");
do {
- nbytes = input_stream_read(is, buffer, sizeof(buffer));
- if(nbytes ==0)
+ nbytes = input_stream_read(is, buffer, sizeof(buffer), &error);
+ if (nbytes == 0) {
+ if (error != NULL) {
+ g_string_free(kf_data, TRUE);
+ g_warning("%s", error->message);
+ g_error_free(error);
+ return NULL;
+ }
+
break;
+ }
+
kf_data = g_string_append_len(kf_data, buffer,nbytes);
/* Limit to 64k */
} while(kf_data->len < 65536);