Silence a few libcurl warnings
About CURLOPT_PROTOCOLS and CURLOPT_REDIR_PROTOCOLS being deprecated in 7.85.0.
This commit is contained in:
parent
d3ab2e231e
commit
a3fe59a2c8
@ -230,12 +230,22 @@ namespace http
|
|||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L);
|
curl_easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
|
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
|
||||||
|
# ifdef ENFORCE_HTTPS
|
||||||
|
curl_easy_setopt(easy, CURLOPT_PROTOCOLS_STR, "https");
|
||||||
|
curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS_STR, "https");
|
||||||
|
# else
|
||||||
|
curl_easy_setopt(easy, CURLOPT_PROTOCOLS_STR, "https,http");
|
||||||
|
curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS_STR, "https,http");
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
# ifdef ENFORCE_HTTPS
|
# ifdef ENFORCE_HTTPS
|
||||||
curl_easy_setopt(easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
|
curl_easy_setopt(easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
|
||||||
curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
|
curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
|
||||||
# else
|
# else
|
||||||
curl_easy_setopt(easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
curl_easy_setopt(easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
||||||
curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetupCurlEasyCiphers(easy);
|
SetupCurlEasyCiphers(easy);
|
||||||
|
@ -468,15 +468,25 @@ namespace LuaTCPSocket
|
|||||||
curl_easy_setopt(tcps->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
curl_easy_setopt(tcps->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
||||||
if (lua_toboolean(l, 4))
|
if (lua_toboolean(l, 4))
|
||||||
{
|
{
|
||||||
|
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
|
||||||
|
curl_easy_setopt(tcps->easy, CURLOPT_PROTOCOLS_STR, "https");
|
||||||
|
curl_easy_setopt(tcps->easy, CURLOPT_REDIR_PROTOCOLS_STR, "https");
|
||||||
|
#else
|
||||||
curl_easy_setopt(tcps->easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
|
curl_easy_setopt(tcps->easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
|
||||||
curl_easy_setopt(tcps->easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
|
curl_easy_setopt(tcps->easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
|
||||||
|
#endif
|
||||||
SetupCurlEasyCiphers(tcps->easy);
|
SetupCurlEasyCiphers(tcps->easy);
|
||||||
address = "https://" + address;
|
address = "https://" + address;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
|
||||||
|
curl_easy_setopt(tcps->easy, CURLOPT_PROTOCOLS_STR, "http");
|
||||||
|
curl_easy_setopt(tcps->easy, CURLOPT_REDIR_PROTOCOLS_STR, "http");
|
||||||
|
#else
|
||||||
curl_easy_setopt(tcps->easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTP);
|
curl_easy_setopt(tcps->easy, CURLOPT_PROTOCOLS, CURLPROTO_HTTP);
|
||||||
curl_easy_setopt(tcps->easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP);
|
curl_easy_setopt(tcps->easy, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP);
|
||||||
|
#endif
|
||||||
address = "http://" + address;
|
address = "http://" + address;
|
||||||
}
|
}
|
||||||
curl_easy_setopt(tcps->easy, CURLOPT_URL, address.c_str());
|
curl_easy_setopt(tcps->easy, CURLOPT_URL, address.c_str());
|
||||||
|
Reference in New Issue
Block a user