From 52ebc9098b16d19777447c27c24ed17d854ed302 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 5 Jan 2023 19:37:23 +0100 Subject: [PATCH] Replaced a deprecated function if building with curl 7.85.0 or newer. --- es-core/src/HttpReq.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/es-core/src/HttpReq.cpp b/es-core/src/HttpReq.cpp index 5b517f707..ea0bc89e5 100644 --- a/es-core/src/HttpReq.cpp +++ b/es-core/src/HttpReq.cpp @@ -136,7 +136,13 @@ HttpReq::HttpReq(const std::string& url) } // Set curl restrict redirect protocols. + +#if LIBCURL_VERSION_MAJOR < 7 || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR < 85) err = curl_easy_setopt(mHandle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); +#else + err = curl_easy_setopt(mHandle, CURLOPT_REDIR_PROTOCOLS_STR, "http,https"); +#endif + if (err != CURLE_OK) { mStatus = REQ_IO_ERROR; onError(curl_easy_strerror(err));