Code

0d9bc34cb1d3f3c4c0cc2e57c3db1f39b860efe9
[pkg-collectd.git] / debian / patches / curl-followlocation.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## curl-followlocation.dpatch by Florian Forster <octo@verplant.org>
3 ##
4 ## DP: Plugins using libcurl: Enable the â€˜CURLOPT_FOLLOWLOCATION’ option.
6 @DPATCH@
8 diff a/src/apache.c b/src/apache.c
9 --- a/src/apache.c
10 +++ b/src/apache.c
11 @@ -160,6 +160,7 @@ static int init (void)
12         }
13  
14         curl_easy_setopt (curl, CURLOPT_URL, url);
15 +       curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
16  
17         if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
18         {
19 diff a/src/ascent.c b/src/ascent.c
20 --- a/src/ascent.c
21 +++ b/src/ascent.c
22 @@ -560,6 +560,7 @@ static int ascent_init (void) /* {{{ */
23    }
24  
25    curl_easy_setopt (curl, CURLOPT_URL, url);
26 +  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
27  
28    if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
29      curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
30 diff a/src/bind.c b/src/bind.c
31 --- a/src/bind.c
32 +++ b/src/bind.c
33 @@ -1395,6 +1395,7 @@ static int bind_init (void) /* {{{ */
34    curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION);
35    curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, bind_curl_error);
36    curl_easy_setopt (curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL);
37 +  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
38  
39    return (0);
40  } /* }}} int bind_init */
41 diff a/src/curl.c b/src/curl.c
42 --- a/src/curl.c
43 +++ b/src/curl.c
44 @@ -346,6 +346,7 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */
45        PACKAGE_NAME"/"PACKAGE_VERSION);
46    curl_easy_setopt (wp->curl, CURLOPT_ERRORBUFFER, wp->curl_errbuf);
47    curl_easy_setopt (wp->curl, CURLOPT_URL, wp->url);
48 +  curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1);
49  
50    if (wp->user != NULL)
51    {
52 diff a/src/nginx.c b/src/nginx.c
53 --- a/src/nginx.c
54 +++ b/src/nginx.c
55 @@ -141,6 +141,8 @@ static int init (void)
56      curl_easy_setopt (curl, CURLOPT_URL, url);
57    }
58  
59 +  curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
60 +
61    if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
62    {
63      curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);