X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=2f990a21c0289c4f4b851a59e500fba575d54730;hb=9b9a04b4e7e8481b7375d5c5d11ab5b813165f14;hp=288949a802113ed0a8d3b049ae02a65bc1dd3344;hpb=99d7118d9ec6fd9b2907cef30bfa91c72b3a5826;p=collectd.git diff --git a/src/bind.c b/src/bind.c index 288949a8..2f990a21 100644 --- a/src/bind.c +++ b/src/bind.c @@ -1395,10 +1395,11 @@ static int bind_init (void) /* {{{ */ curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, bind_curl_callback); - curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); + 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); return (0); } /* }}} int bind_init */ @@ -1414,7 +1415,7 @@ static int bind_read (void) /* {{{ */ } bind_buffer_fill = 0; - if (curl_easy_perform (curl) != 0) + if (curl_easy_perform (curl) != CURLE_OK) { ERROR ("bind plugin: curl_easy_perform failed: %s", bind_curl_error);