Code

patches: Added curl-followlocation.dpatch.
authorSebastian Harl <sh@tokkee.org>
Thu, 27 Aug 2009 21:31:06 +0000 (23:31 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 27 Aug 2009 21:31:06 +0000 (23:31 +0200)
This is an upstream patch to let plugins using libcurl follow HTTP redirects.
Thanks to Joey Hess for reporting this.

Closes: #541953
debian/changelog
debian/patches/00list
debian/patches/curl-followlocation.dpatch [new file with mode: 0755]

index c7add8d0437208408a281c15b33b21a295a74c10..8ac3a6b647913a730bd37fb8cecd8b975302d748 100644 (file)
@@ -43,6 +43,9 @@ collectd (4.7.2-1) unstable; urgency=low
       'plugin_unregister_read()' functional again, thus fixing a failed
       assertion in some cases.
     - Added java-fix-jvm-start.dpatch - upstream patch to fix the JVM startup.
+    - Added curl-followlocation.dpatch - upstream patch to let plugins using
+      libcurl follow HTTP redirects; thanks to Joey Hess for reporting this
+      (Closes: #541953).
   * debian/README.Debian:
     - Removed the note about how to get collectd2html.pl working with
       version 4 of collectd - the script now supports the --recursive option
@@ -60,7 +63,7 @@ collectd (4.7.2-1) unstable; urgency=low
     - Set the 'apache' plugin's URL according to the default used by Debian's
       Apache; thanks to Joey Hess for reporting this (Closes: #541888).
 
- -- Sebastian Harl <tokkee@debian.org>  Thu, 27 Aug 2009 23:23:16 +0200
+ -- Sebastian Harl <tokkee@debian.org>  Thu, 27 Aug 2009 23:29:41 +0200
 
 collectd (4.6.3-1) unstable; urgency=low
 
index 7297c986cedfaceb709d43dd4d12529dd9a0f2dc..cdf98cff912446092f8ec992642873545ad2c8a8 100644 (file)
@@ -4,4 +4,5 @@ network-fix-cacheflush.dpatch
 libvirt-reconnect.dpatch
 plugin-fix-unregister.dpatch
 java-fix-jvm-start.dpatch
+curl-followlocation.dpatch
 
diff --git a/debian/patches/curl-followlocation.dpatch b/debian/patches/curl-followlocation.dpatch
new file mode 100755 (executable)
index 0000000..0d9bc34
--- /dev/null
@@ -0,0 +1,63 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## curl-followlocation.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: Plugins using libcurl: Enable the â€˜CURLOPT_FOLLOWLOCATION’ option.
+
+@DPATCH@
+
+diff a/src/apache.c b/src/apache.c
+--- 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 a/src/ascent.c b/src/ascent.c
+--- 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 a/src/bind.c b/src/bind.c
+--- 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 a/src/curl.c b/src/curl.c
+--- 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 a/src/nginx.c b/src/nginx.c
+--- 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);