Code

patches: Added bts592623-curl_json-file.
authorSebastian Harl <sh@tokkee.org>
Wed, 8 Sep 2010 20:26:31 +0000 (22:26 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 8 Sep 2010 20:26:31 +0000 (22:26 +0200)
This is an upstream patch fixing access to file:// URLs in the 'curl_json'
plugin.

Thanks Baptiste Mille-Mathias for reporting this and pointing out the patch!
Closes: #592623
debian/changelog
debian/patches/00list
debian/patches/bts592623-curl_json-file.dpatch [new file with mode: 0755]

index 6a55b3054d599e3c02ced41577966b7b50a510ef..c220dd808bd13fa7b1e3c4c1a4ad6b8cbb584eb2 100644 (file)
@@ -4,8 +4,11 @@ collectd (4.10.1-2) unstable; urgency=low
     - Added bts595756-notify_email-segfault -- upstream patch fixing a
       segfault in the 'notify_email' plugin; thanks to Manuel CISSE for
       reporting this (Closes: #595756).
+    - Added bts592623-curl_json-file -- upstream patch fixing access to
+      file:// URLs in the 'curl_json' plugin; thanks Baptiste Mille-Mathias
+      for reporting this and pointing out the patch (Closes: #592623).
 
- -- Sebastian Harl <tokkee@debian.org>  Wed, 08 Sep 2010 22:12:56 +0200
+ -- Sebastian Harl <tokkee@debian.org>  Wed, 08 Sep 2010 22:25:05 +0200
 
 collectd (4.10.1-1) unstable; urgency=low
 
index f781a027107a130345e2e20befafe38a55f13e81..e186cd0a396ef3f3782a9821a7151eb9e3309f0c 100644 (file)
@@ -2,4 +2,5 @@ rrd_filter_path.dpatch
 collection_conf_path.dpatch
 bts559801_plugin_find_fix.dpatch
 bts595756-notify_email-segfault.dpatch
+bts592623-curl_json-file.dpatch
 
diff --git a/debian/patches/bts592623-curl_json-file.dpatch b/debian/patches/bts592623-curl_json-file.dpatch
new file mode 100755 (executable)
index 0000000..d143bc8
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts592623-curl_json-file.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: curl json: Fix checking the response code.
+## DP:
+## DP: This fixes access to file:// URLs.
+
+@DPATCH@
+
+diff a/src/curl_json.c b/src/curl_json.c
+--- a/src/curl_json.c
++++ b/src/curl_json.c
+@@ -775,7 +775,8 @@ static int cj_curl_perform (cj_t *db, CURL *curl) /* {{{ */
+   curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
+   curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc);
+-  if (rc != 200)
++  /* The response code is zero if a non-HTTP transport was used. */
++  if ((rc != 0) && (rc != 200))
+   {
+     ERROR ("curl_json plugin: curl_easy_perform failed with response code %ld (%s)",
+            rc, url);