From db89cb86da24cbf26f598079a5c741cb0d074f68 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Jan 2009 16:12:44 +0100 Subject: 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(). --- src/input_curl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/input_curl.c') 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 */ -- cgit v1.2.3