From: Marc Fournier Date: Fri, 16 Jan 2015 22:45:26 +0000 (+0100) Subject: ensure all curl-based plugins follow HTTP redirects X-Git-Tag: collectd-5.5.0~91 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ef77268059b78e11226a23b72f500238e83d399a;p=collectd.git ensure all curl-based plugins follow HTTP redirects For the sake of consistency. --- diff --git a/src/curl_json.c b/src/curl_json.c index b79c999e..09db7866 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -608,6 +608,8 @@ static int cj_init_curl (cj_t *db) /* {{{ */ curl_easy_setopt (db->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt (db->curl, CURLOPT_ERRORBUFFER, db->curl_errbuf); curl_easy_setopt (db->curl, CURLOPT_URL, db->url); + curl_easy_setopt (db->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt (db->curl, CURLOPT_MAXREDIRS, 50L); if (db->user != NULL) { diff --git a/src/curl_xml.c b/src/curl_xml.c index c0ab6fdb..c9f06518 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -842,6 +842,8 @@ static int cx_init_curl (cx_t *db) /* {{{ */ curl_easy_setopt (db->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt (db->curl, CURLOPT_ERRORBUFFER, db->curl_errbuf); curl_easy_setopt (db->curl, CURLOPT_URL, db->url); + curl_easy_setopt (db->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt (db->curl, CURLOPT_MAXREDIRS, 50L); if (db->user != NULL) { diff --git a/src/write_http.c b/src/write_http.c index d97bc9b5..eab1f617 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -134,6 +134,8 @@ static int wh_callback_init (wh_callback_t *cb) /* {{{ */ curl_easy_setopt (cb->curl, CURLOPT_ERRORBUFFER, cb->curl_errbuf); curl_easy_setopt (cb->curl, CURLOPT_URL, cb->location); + curl_easy_setopt (cb->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt (cb->curl, CURLOPT_MAXREDIRS, 50L); if (cb->user != NULL) {