X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fbind.c;h=824d044719d3f71c42f5b899ef68f063ab7d188b;hp=b7308ad83ae7707a9b992aa0a168f1b9ae850593;hb=9655d4a6d9fa2c4f02032759b831e93933d68bd9;hpb=f3c9335402d5853f98645ca28080600bf565f1ce diff --git a/src/bind.c b/src/bind.c index b7308ad8..824d0447 100644 --- a/src/bind.c +++ b/src/bind.c @@ -1598,7 +1598,6 @@ static int bind_init(void) /* {{{ */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, bind_curl_callback); curl_easy_setopt(curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, bind_curl_error); - curl_easy_setopt(curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L); #ifdef HAVE_CURLOPT_TIMEOUT_MS @@ -1620,6 +1619,9 @@ static int bind_read(void) /* {{{ */ } bind_buffer_fill = 0; + + curl_easy_setopt(curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL); + if (curl_easy_perform(curl) != CURLE_OK) { ERROR("bind plugin: curl_easy_perform failed: %s", bind_curl_error); return -1;