X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=8f6382b844cd281e231a12358973dd8875520d05;hb=55ffaf9ad7c8b180ac0192adb1a6ff6adc72c5a3;hp=6f31145cc5b785a8339a1b4b1c5a2ff076bddb15;hpb=e56c1e570ff8d4e8fe732f9d74f11217479fdd7b;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 6f31145c..8f6382b8 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -562,7 +562,6 @@ static int cj_init_curl(cj_t *db) /* {{{ */ curl_easy_setopt(db->curl, CURLOPT_WRITEDATA, db); curl_easy_setopt(db->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt(db->curl, CURLOPT_ERRORBUFFER, db->curl_errbuf); - curl_easy_setopt(db->curl, CURLOPT_URL, db->url); curl_easy_setopt(db->curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(db->curl, CURLOPT_MAXREDIRS, 50L); @@ -841,12 +840,13 @@ static int cj_curl_perform(cj_t *db) /* {{{ */ int status; long rc; char *url; - url = db->url; + + curl_easy_setopt(db->curl, CURLOPT_URL, db->url); status = curl_easy_perform(db->curl); if (status != CURLE_OK) { ERROR("curl_json plugin: curl_easy_perform failed with status %i: %s (%s)", - status, db->curl_errbuf, url); + status, db->curl_errbuf, db->url); return (-1); } if (db->stats != NULL)