diff options
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/curl_input_plugin.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/input/curl_input_plugin.c b/src/input/curl_input_plugin.c index 76d8fe8f7..f344c3f11 100644 --- a/src/input/curl_input_plugin.c +++ b/src/input/curl_input_plugin.c @@ -82,9 +82,6 @@ struct input_curl { /** has something been added to the buffers list? */ bool buffered; - /** did libcurl tell us the we're at the end of the response body? */ - bool eof; - /** error message provided by libcurl */ char error[CURL_ERROR_SIZE]; @@ -207,7 +204,6 @@ input_curl_easy_free(struct input_curl *c) g_free(c->range); c->range = NULL; - c->eof = true; c->base.ready = true; } @@ -285,7 +281,7 @@ input_curl_select(struct input_curl *c, GError **error_r) .tv_usec = 0, }; - assert(!c->eof); + assert(c->easy != NULL); FD_ZERO(&rfds); FD_ZERO(&wfds); @@ -331,7 +327,7 @@ fill_buffer(struct input_curl *c, GError **error_r) { CURLMcode mcode = CURLM_CALL_MULTI_PERFORM; - while (!c->eof && g_queue_is_empty(c->buffers)) { + while (c->easy != NULL && g_queue_is_empty(c->buffers)) { int running_handles; bool bret; @@ -499,7 +495,7 @@ input_curl_eof(G_GNUC_UNUSED struct input_stream *is) { struct input_curl *c = (struct input_curl *)is; - return c->eof && g_queue_is_empty(c->buffers); + return c->easy == NULL && g_queue_is_empty(c->buffers); } static int @@ -516,7 +512,7 @@ input_curl_buffer(struct input_stream *is, GError **error_r) c->buffered = false; - if (!is->ready && !c->eof) + if (!is->ready && c->easy != NULL) /* not ready yet means the caller is waiting in a busy loop; relax that by calling select() on the socket */ @@ -656,8 +652,6 @@ input_curl_easy_init(struct input_curl *c, GError **error_r) CURLcode code; CURLMcode mcode; - c->eof = false; - c->easy = curl_easy_init(); if (c->easy == NULL) { g_set_error(error_r, curl_quark(), 0, @@ -810,7 +804,6 @@ input_curl_seek(struct input_stream *is, goffset offset, int whence, /* seek to EOF: simulate empty result; avoid triggering a "416 Requested Range Not Satisfiable" response */ - c->eof = true; return true; } |