X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=990e2ca7de4d0a17cc2c3c3ee25f8434d14c9e88;hb=9c6c1bdb92537f307d245c52349d3f196ec4d33d;hp=49fb4d7fe0d7fba1cd442cda411b585ca9dbbc0c;hpb=e746ad785774de37a30302fef65f1c4aaf8698ab;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 49fb4d7f..990e2ca7 100644 --- a/src/bind.c +++ b/src/bind.c @@ -1597,7 +1597,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 @@ -1619,6 +1618,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;