X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=824d044719d3f71c42f5b899ef68f063ab7d188b;hb=d46c9cada2398d5508205e745c42c1cdc6efd1e9;hp=b7308ad83ae7707a9b992aa0a168f1b9ae850593;hpb=867ad628dc6fcd05bd584b605d7093cfc00c3d07;p=collectd.git 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;