From: Art Cancro Date: Thu, 18 Jun 2009 02:52:38 +0000 (+0000) Subject: * Older versions of libcurl may not have CURLOPT_HTTP_CONTENT_DECODING support. ... X-Git-Tag: v7.86~1036 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=99388bda231aa067339ca93539d3d3bb14fedcb1 * Older versions of libcurl may not have CURLOPT_HTTP_CONTENT_DECODING support. Added an ifdef to only use this option when it is available. --- diff --git a/citadel/modules/openid/serv_openid_rp.c b/citadel/modules/openid/serv_openid_rp.c index 2ca70f32a..4c191e00b 100644 --- a/citadel/modules/openid/serv_openid_rp.c +++ b/citadel/modules/openid/serv_openid_rp.c @@ -540,8 +540,10 @@ int fetch_http(char *url, char *target_buf, int maxbytes, int normalize_len) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fh_callback); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); +#ifdef CURLOPT_HTTP_CONTENT_DECODING curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 1); curl_easy_setopt(curl, CURLOPT_ENCODING, ""); +#endif curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */ if (!IsEmptyStr(config.c_ip_addr)) { @@ -758,8 +760,10 @@ void cmd_oidf(char *argbuf) { curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); +#ifdef CURLOPT_HTTP_CONTENT_DECODING curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 1); curl_easy_setopt(curl, CURLOPT_ENCODING, ""); +#endif curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */ if (!IsEmptyStr(config.c_ip_addr)) { diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/modules/rssclient/serv_rssclient.c index 13b26ba3b..0fda7a457 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/modules/rssclient/serv_rssclient.c @@ -399,8 +399,10 @@ void rss_do_fetching(char *url, char *rooms) { curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, rss_libcurl_callback); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); +#ifdef CURLOPT_HTTP_CONTENT_DECODING curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 1); curl_easy_setopt(curl, CURLOPT_ENCODING, ""); +#endif curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */ if (!IsEmptyStr(config.c_ip_addr)) {