X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fapache.c;h=50784e5f1ff9b0d4f31e3fd42fba4e61ac873703;hp=35e02ab5f9bfb21fa46c6482b6e1db9bb4c87e91;hb=e7a7be6760b7f79780e9e9ed10fa9e029a3faa38;hpb=2079ee1517e34de372f58e7e2267ad5c71a8a41f diff --git a/src/apache.c b/src/apache.c index 35e02ab5..50784e5f 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); @@ -514,6 +513,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);