* Older versions of libcurl may not have CURLOPT_HTTP_CONTENT_DECODING support. ...
[citadel.git] / citadel / modules / openid / serv_openid_rp.c
index 2ca70f32a777d1106e6da71914dab81f7a82ff2d..4c191e00b1b45d261d3dbc8634111faeb8dcbae0 100644 (file)
@@ -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)) {