X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcurl.c;h=cde383d38a277283e9a59a735957d61285edb5db;hp=808f2429ec4f0354f6f9cff31fd4e227d38882ce;hb=9655d4a6d9fa2c4f02032759b831e93933d68bd9;hpb=f3c9335402d5853f98645ca28080600bf565f1ce diff --git a/src/curl.c b/src/curl.c index 808f2429..cde383d3 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); @@ -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,