X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnginx.c;h=060eae23b1712c79f09ecc43fd29d7208a590289;hb=4962291342f14fecbc6bb0240bd8ec7c76e2fc64;hp=ffc545c42770846d084220f6da86dff0812bcdbf;hpb=877672d20fcf0ed25f5fc5faa8aa3964c622bc27;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);