X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_xml.c;h=052ea1e61244d92d509501ea0daf800f19f454f3;hb=970acd869b9a8ef076ed5434b2a26ab3217750ce;hp=c10955cb973a803902968781cdc73573d32f46b4;hpb=97addf1e406c75be500ae020635f3cb389f206e0;p=collectd.git diff --git a/src/curl_xml.c b/src/curl_xml.c index c10955cb..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); @@ -734,6 +735,7 @@ static int cx_init_curl (cx_t *db) /* {{{ */ return (-1); } + curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (db->curl, CURLOPT_WRITEFUNCTION, cx_curl_callback); curl_easy_setopt (db->curl, CURLOPT_WRITEDATA, db); curl_easy_setopt (db->curl, CURLOPT_USERAGENT,