X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl.c;h=cc48c77491f8ea281992ecb48c78526323864b66;hb=243163d9a20ed9961f6c2eefe59b411b5c39d707;hp=808f2429ec4f0354f6f9cff31fd4e227d38882ce;hpb=47c86ace348a1d7a5352a83d10935209f89aa4f5;p=collectd.git diff --git a/src/curl.c b/src/curl.c index 808f2429..cc48c774 100644 --- a/src/curl.c +++ b/src/curl.c @@ -347,7 +347,6 @@ static int cc_page_init_curl(web_page_t *wp) /* {{{ */ curl_easy_setopt(wp->curl, CURLOPT_WRITEDATA, wp); curl_easy_setopt(wp->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt(wp->curl, CURLOPT_ERRORBUFFER, wp->curl_errbuf); - curl_easy_setopt(wp->curl, CURLOPT_URL, wp->url); curl_easy_setopt(wp->curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(wp->curl, CURLOPT_MAXREDIRS, 50L); @@ -369,8 +368,8 @@ static int cc_page_init_curl(web_page_t *wp) /* {{{ */ return -1; } - ssnprintf(wp->credentials, credentials_size, "%s:%s", wp->user, - (wp->pass == NULL) ? "" : wp->pass); + snprintf(wp->credentials, credentials_size, "%s:%s", wp->user, + (wp->pass == NULL) ? "" : wp->pass); curl_easy_setopt(wp->curl, CURLOPT_USERPWD, wp->credentials); #endif @@ -611,6 +610,9 @@ static int cc_read_page(web_page_t *wp) /* {{{ */ start = cdtime(); wp->buffer_fill = 0; + + curl_easy_setopt(wp->curl, CURLOPT_URL, wp->url); + status = curl_easy_perform(wp->curl); if (status != CURLE_OK) { ERROR("curl plugin: curl_easy_perform failed with status %i: %s", status,