diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-11-11 15:20:00 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-11-12 14:40:37 +0100 |
commit | 15d715daceb06ee4521606cd95354147fabe0216 (patch) | |
tree | f948b060a10932a57a325263689b57948792cdde /src | |
parent | fdfbd401c3ba535ed241a27f873a0121b928a79a (diff) | |
download | strongswan-15d715daceb06ee4521606cd95354147fabe0216.tar.bz2 strongswan-15d715daceb06ee4521606cd95354147fabe0216.tar.xz |
curl: Be less strict when considering status codes as errors
For file:// URIs the code is 0 on success. We now do the same libcurl
would do with CURLOPT_FAILONERROR enabled.
Fixes #1203.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/plugins/curl/curl_fetcher.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/plugins/curl/curl_fetcher.c b/src/libstrongswan/plugins/curl/curl_fetcher.c index 7653c1986..9207f11b6 100644 --- a/src/libstrongswan/plugins/curl/curl_fetcher.c +++ b/src/libstrongswan/plugins/curl/curl_fetcher.c @@ -123,7 +123,7 @@ METHOD(fetcher_t, fetch, status_t, curl_easy_setopt(this->curl, CURLOPT_HTTPHEADER, this->headers); } - DBG2(DBG_LIB, " sending http request to '%s'...", uri); + DBG2(DBG_LIB, " sending request to '%s'...", uri); curl_status = curl_easy_perform(this->curl); switch (curl_status) { @@ -137,10 +137,10 @@ METHOD(fetcher_t, fetch, status_t, { *this->result = result; } - status = (result >= 200 && result < 300) ? SUCCESS : FAILED; + status = (result < 400) ? SUCCESS : FAILED; break; default: - DBG1(DBG_LIB, "libcurl http request failed [%d]: %s", curl_status, + DBG1(DBG_LIB, "libcurl request failed [%d]: %s", curl_status, error); status = FAILED; break; |