X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcurl_json.c;fp=src%2Fcurl_json.c;h=c0f9346508214cd5ecb90e89df8f556cb3020c9d;hb=e7a7be6760b7f79780e9e9ed10fa9e029a3faa38;hp=9cdd4fe80aa9476e4b25d1ea1d0c5d94c92cc62e;hpb=24bdf52decaf93359aab0364fb11420af5cd4a21;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 9cdd4fe8..c0f93465 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); @@ -840,12 +839,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)