X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fapache.c;fp=src%2Fapache.c;h=92c2c8be6c130174d7924d66c5cd20da983fe34f;hp=e2f75c180ae219dfeb81d7abfdfa5fda0b54db25;hb=9655d4a6d9fa2c4f02032759b831e93933d68bd9;hpb=f3c9335402d5853f98645ca28080600bf565f1ce diff --git a/src/apache.c b/src/apache.c index e2f75c18..92c2c8be 100644 --- a/src/apache.c +++ b/src/apache.c @@ -328,7 +328,6 @@ static int init_host(apache_t *st) /* {{{ */ #endif } - curl_easy_setopt(st->curl, CURLOPT_URL, st->url); curl_easy_setopt(st->curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(st->curl, CURLOPT_MAXREDIRS, 50L); @@ -510,6 +509,9 @@ static int apache_read_host(user_data_t *user_data) /* {{{ */ assert(st->curl != NULL); st->apache_buffer_fill = 0; + + curl_easy_setopt(st->curl, CURLOPT_URL, st->url); + if (curl_easy_perform(st->curl) != CURLE_OK) { ERROR("apache: curl_easy_perform failed: %s", st->apache_curl_error); return -1;