X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcurl_xml.c;h=e83de73ea6c07cefe0595af6342417a61bc86d48;hb=4eca75de34e9c3d7f2391b9c7a5951a27a713804;hp=8eb99811e34044b2d65f0c6f947b6ea38e5801e9;hpb=e746ad785774de37a30302fef65f1c4aaf8698ab;p=collectd.git diff --git a/src/curl_xml.c b/src/curl_xml.c index 8eb99811..e83de73e 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -602,13 +602,15 @@ static int cx_curl_perform(cx_t *db, CURL *curl) /* {{{ */ long rc; char *ptr; char *url; - url = db->url; db->buffer_fill = 0; + + curl_easy_setopt(db->curl, CURLOPT_URL, db->url); + status = curl_easy_perform(curl); if (status != CURLE_OK) { ERROR("curl_xml 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) @@ -817,7 +819,6 @@ static int cx_init_curl(cx_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);