aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-15 16:12:44 +0100
committerMax Kellermann <max@duempel.org>2009-01-15 16:12:44 +0100
commitdb89cb86da24cbf26f598079a5c741cb0d074f68 (patch)
treefb9b574e7a079adf56acce158976b1c96b661bc9
parenta9cfa6023f6c8991aac622d1f51619922cf4ed02 (diff)
downloadmpd-db89cb86da24cbf26f598079a5c741cb0d074f68.tar.gz
mpd-db89cb86da24cbf26f598079a5c741cb0d074f68.tar.xz
mpd-db89cb86da24cbf26f598079a5c741cb0d074f68.zip
input_curl: don't call input_curl_select() when already at EOF
Calling input_curl_select() after EOF has been reached causes an assertion failure. This can happen if the HTTP response is empty. Check c->eof before calling input_curl_select().
-rw-r--r--src/input_curl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/input_curl.c b/src/input_curl.c
index dd74ed59e..328d80751 100644
--- a/src/input_curl.c
+++ b/src/input_curl.c
@@ -189,6 +189,8 @@ input_curl_select(struct input_curl *c)
.tv_usec = 0,
};
+ assert(!c->eof);
+
FD_ZERO(&rfds);
FD_ZERO(&wfds);
FD_ZERO(&efds);
@@ -347,7 +349,7 @@ input_curl_buffer(struct input_stream *is)
c->buffered = false;
- if (!is->ready)
+ if (!is->ready && !c->eof)
/* not ready yet means the caller is waiting in a busy
loop; relax that by calling select() on the
socket */