Code

Fix file:// not working as return code is 0 and not 200, as fixed
authorFabien Wernli <cpan@faxm0dem.org>
Fri, 4 Nov 2011 10:25:59 +0000 (11:25 +0100)
committerFlorian Forster <octo@collectd.org>
Fri, 25 Nov 2011 09:47:07 +0000 (10:47 +0100)
beforehand in curl_json.
Remove mention of http in documention as file also works now (and ftp most likely too)

Change-Id: Iccb35e6b8c831f555dc5bbd17fa8d04672e13eb3

src/collectd.conf.pod
src/curl_xml.c

index 187133cdb90e481392bcd3a9e9f75403f760b25c..62374b625cb204ab9aa3f6dc9c6a8f73fa8c5e37 100644 (file)
@@ -685,7 +685,7 @@ The B<curl_xml plugin> uses B<libcurl> (L<http://curl.haxx.se/>) and B<libxml2>
  </Plugin>
 
 In the B<Plugin> block, there may be one or more B<URL> blocks, each defining a
-URL to be fetched via HTTP (using libcurl). Within each B<URL> block there are
+URL to be fetched using libcurl. Within each B<URL> block there are
 options which specify the connection parameters, for example authentication
 information, and one or more B<XPath> blocks.
 
index 61b5adedf423a4a770da06d066b1e372b767dfcb..052ea1e61244d92d509501ea0daf800f19f454f3 100644 (file)
@@ -555,7 +555,8 @@ static int cx_curl_perform (cx_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_xml plugin: curl_easy_perform failed with response code %ld (%s)",
            rc, url);