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);
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,