X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl.c;h=32ba74527405a8393767a1901093fd571db01c3c;hb=d6021a800b12c89b5a78877af2c5b9abc1a8e609;hp=8b95c80febb279a1c6f2e0579787274bb113967f;hpb=0eff156c7816507fa1865b76e948574dd320fae0;p=collectd.git diff --git a/src/curl.c b/src/curl.c index 8b95c80f..32ba7452 100644 --- a/src/curl.c +++ b/src/curl.c @@ -370,13 +370,15 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */ return (-1); } + curl_easy_setopt (wp->curl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt (wp->curl, CURLOPT_WRITEFUNCTION, cc_curl_callback); curl_easy_setopt (wp->curl, CURLOPT_WRITEDATA, wp); curl_easy_setopt (wp->curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); 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, 1); + curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt (wp->curl, CURLOPT_MAXREDIRS, 50L); if (wp->user != NULL) { @@ -398,9 +400,9 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */ curl_easy_setopt (wp->curl, CURLOPT_USERPWD, wp->credentials); } - curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, wp->verify_peer); + curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYPEER, (long) wp->verify_peer); curl_easy_setopt (wp->curl, CURLOPT_SSL_VERIFYHOST, - wp->verify_host ? 2 : 0); + wp->verify_host ? 2L : 0L); if (wp->cacert != NULL) curl_easy_setopt (wp->curl, CURLOPT_CAINFO, wp->cacert); @@ -614,7 +616,7 @@ static int cc_read_page (web_page_t *wp) /* {{{ */ wp->buffer_fill = 0; status = curl_easy_perform (wp->curl); - if (status != 0) + if (status != CURLE_OK) { ERROR ("curl plugin: curl_easy_perform failed with staus %i: %s", status, wp->curl_errbuf);