Commit a7461dc2 authored by Max Kellermann's avatar Max Kellermann

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().
parent f1790fc8
......@@ -225,6 +225,8 @@ input_curl_select(struct input_curl *c)
.tv_usec = 0,
};
assert(!c->eof);
FD_ZERO(&rfds);
FD_ZERO(&wfds);
FD_ZERO(&efds);
......@@ -478,7 +480,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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment