From daaa643bbf925e8f6f40649bba7b4c93911a1725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 29 Jul 2015 10:00:25 +0200 Subject: [PATCH] support cURL versions older than 7.21.6 prior to cURL 7.21.6, CURLOPT_ACCEPT_ENCODING was called CURLOPT_ENCODING --- platform/default/http_request_curl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp index 22cb1df6f..0f7f8c0ac 100644 --- a/platform/default/http_request_curl.cpp +++ b/platform/default/http_request_curl.cpp @@ -470,7 +470,11 @@ HTTPCURLRequest::HTTPCURLRequest(HTTPCURLContext* context_, const Resource& reso handleError(curl_easy_setopt(handle, CURLOPT_WRITEDATA, this)); handleError(curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, headerCallback)); handleError(curl_easy_setopt(handle, CURLOPT_HEADERDATA, this)); +#if LIBCURL_VERSION_NUM >= ((7) << 16 | (21) << 8 | 6) // Renamed in 7.21.6 handleError(curl_easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, "gzip, deflate")); +#else + handleError(curl_easy_setopt(handle, CURLOPT_ENCODING, "gzip, deflate")); +#endif handleError(curl_easy_setopt(handle, CURLOPT_USERAGENT, "MapboxGL/1.0")); handleError(curl_easy_setopt(handle, CURLOPT_SHARE, context->share));