Replaced a deprecated function if building with curl 7.85.0 or newer.

This commit is contained in:
Leon Styhre 2023-01-05 19:37:23 +01:00
parent d21a09123f
commit 52ebc9098b

View file

@ -136,7 +136,13 @@ HttpReq::HttpReq(const std::string& url)
} }
// Set curl restrict redirect protocols. // 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); 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) { if (err != CURLE_OK) {
mStatus = REQ_IO_ERROR; mStatus = REQ_IO_ERROR;
onError(curl_easy_strerror(err)); onError(curl_easy_strerror(err));