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