From: Florian Forster Date: Thu, 20 Aug 2009 11:48:23 +0000 (+0200) Subject: Plugins using libcurl: Enable the ‘CURLOPT_FOLLOWLOCATION’ option. X-Git-Tag: collectd-4.6.5~21 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=17a04c7afcf44707f6bc45697212c1f8fc6aa761 Plugins using libcurl: Enable the ‘CURLOPT_FOLLOWLOCATION’ option. This hopefully fixes Debian#541953. --- diff --git a/src/apache.c b/src/apache.c index 4fa7aa1b..6489bce2 100644 --- a/src/apache.c +++ b/src/apache.c @@ -160,6 +160,7 @@ static int init (void) } curl_easy_setopt (curl, CURLOPT_URL, url); + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1); if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0)) { diff --git a/src/ascent.c b/src/ascent.c index 8829e518..1e7eca14 100644 --- a/src/ascent.c +++ b/src/ascent.c @@ -560,6 +560,7 @@ static int ascent_init (void) /* {{{ */ } curl_easy_setopt (curl, CURLOPT_URL, url); + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1); if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0)) curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1); diff --git a/src/bind.c b/src/bind.c index 44efcfd5..51a6079b 100644 --- a/src/bind.c +++ b/src/bind.c @@ -1395,6 +1395,7 @@ static int bind_init (void) /* {{{ */ curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); 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, 1); return (0); } /* }}} int bind_init */ diff --git a/src/curl.c b/src/curl.c index 88b5496d..d3c307e4 100644 --- a/src/curl.c +++ b/src/curl.c @@ -346,6 +346,7 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */ 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); if (wp->user != NULL) { diff --git a/src/nginx.c b/src/nginx.c index cea3c844..53137a71 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -141,6 +141,8 @@ static int init (void) curl_easy_setopt (curl, CURLOPT_URL, url); } + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1); + if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0)) { curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);