X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fapache.c;h=29c36cc0f9e1201e5239565d0d2d456a0ce21ffb;hp=eaef61b134e9edde6c34d5d4126e1084b1152e62;hb=f374b72032a227a75b6bc9ae574cd28abbc16f24;hpb=facbb03bdd0c591344b1a81dd0437064cfcc24e5 diff --git a/src/apache.c b/src/apache.c index eaef61b1..29c36cc0 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);