X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnginx.c;h=060eae23b1712c79f09ecc43fd29d7208a590289;hb=01d23e3f5daf016d03f82d92a76be2fe3decdca4;hp=ffc545c42770846d084220f6da86dff0812bcdbf;hpb=e56c1e570ff8d4e8fe732f9d74f11217479fdd7b;p=collectd.git diff --git a/src/nginx.c b/src/nginx.c index ffc545c4..060eae23 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -133,10 +133,6 @@ static int init(void) { #endif } - if (url != NULL) { - curl_easy_setopt(curl, CURLOPT_URL, url); - } - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L); @@ -207,6 +203,9 @@ static int nginx_read(void) { return (-1); nginx_buffer_len = 0; + + curl_easy_setopt(curl, CURLOPT_URL, url); + if (curl_easy_perform(curl) != CURLE_OK) { WARNING("nginx plugin: curl_easy_perform failed: %s", nginx_curl_error); return (-1);