Code

patches: Removed bts595756-notify_email-segfault -- included upstream.
[pkg-collectd.git] / debian / patches / bts592623-curl_json-file.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## bts592623-curl_json-file.dpatch by Florian Forster <octo@verplant.org>
3 ##
4 ## DP: curl json: Fix checking the response code.
5 ## DP:
6 ## DP: This fixes access to file:// URLs.
8 @DPATCH@
10 diff a/src/curl_json.c b/src/curl_json.c
11 --- a/src/curl_json.c
12 +++ b/src/curl_json.c
13 @@ -775,7 +775,8 @@ static int cj_curl_perform (cj_t *db, CURL *curl) /* {{{ */
14    curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
15    curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc);
16  
17 -  if (rc != 200)
18 +  /* The response code is zero if a non-HTTP transport was used. */
19 +  if ((rc != 0) && (rc != 200))
20    {
21      ERROR ("curl_json plugin: curl_easy_perform failed with response code %ld (%s)",
22             rc, url);