X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fnginx.c;h=c7e8a08e976fd66c8d51e5b17b7cc8256efce3bf;hp=0f1da0aebdfeb522f15182b91255e5b2ebef12ff;hb=9655d4a6d9fa2c4f02032759b831e93933d68bd9;hpb=f3c9335402d5853f98645ca28080600bf565f1ce diff --git a/src/nginx.c b/src/nginx.c index 0f1da0ae..c7e8a08e 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;