X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcurl_json.c;fp=src%2Fcurl_json.c;h=cc5600f3d92ee3ef5089564c3e955ba3c32abbac;hp=8037742adb939214789d172da67e6981ef5372ab;hb=9655d4a6d9fa2c4f02032759b831e93933d68bd9;hpb=f3c9335402d5853f98645ca28080600bf565f1ce diff --git a/src/curl_json.c b/src/curl_json.c index 8037742a..cc5600f3 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -578,7 +578,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); @@ -858,12 +857,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)