From 7f88689783624f3555b714d6489c5f0ca4ab7e86 Mon Sep 17 00:00:00 2001 From: Fabien Wernli Date: Fri, 4 Nov 2011 11:25:59 +0100 Subject: [PATCH] Fix file:// not working as return code is 0 and not 200, as fixed 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 | 2 +- src/curl_xml.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 187133cd..62374b62 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -685,7 +685,7 @@ The B uses B (L) and B In the B block, there may be one or more B blocks, each defining a -URL to be fetched via HTTP (using libcurl). Within each B block there are +URL to be fetched using libcurl. Within each B block there are options which specify the connection parameters, for example authentication information, and one or more B blocks. diff --git a/src/curl_xml.c b/src/curl_xml.c index 61b5aded..052ea1e6 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -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); -- 2.30.2