diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2024-02-12 13:43:19 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2024-02-12 13:43:43 +0100 |
commit | 966f4c1279990033b53c476a1064184c3ec2feef (patch) | |
tree | b33256e468f47a3cfdfd705289279312ee8f6e6d | |
parent | d0a5cb0b11df67fe81a3ba0c92e6eecd5702d719 (diff) | |
download | gnunet-966f4c1279990033b53c476a1064184c3ec2feef.tar.gz gnunet-966f4c1279990033b53c476a1064184c3ec2feef.zip |
hostlist: fix curl protocol option regression
-rw-r--r-- | src/service/hostlist/gnunet-daemon-hostlist_client.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/service/hostlist/gnunet-daemon-hostlist_client.c b/src/service/hostlist/gnunet-daemon-hostlist_client.c index 826f6b444..9388c8940 100644 --- a/src/service/hostlist/gnunet-daemon-hostlist_client.c +++ b/src/service/hostlist/gnunet-daemon-hostlist_client.c | |||
@@ -1040,10 +1040,32 @@ download_hostlist () | |||
1040 | return; | 1040 | return; |
1041 | } | 1041 | } |
1042 | CURL_EASY_SETOPT (curl, CURLOPT_FOLLOWLOCATION, 1); | 1042 | CURL_EASY_SETOPT (curl, CURLOPT_FOLLOWLOCATION, 1); |
1043 | CURL_EASY_SETOPT (curl, | 1043 | #ifdef CURLOPT_REDIR_PROTOCOLS_STR |
1044 | CURLOPT_REDIR_PROTOCOLS_STR, | 1044 | if (0 == strncasecmp (current_url, "https://", strlen ("https://"))) |
1045 | CURLPROTO_HTTP | CURLPROTO_HTTPS); | 1045 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS_STR, "https")); |
1046 | CURL_EASY_SETOPT (curl, CURLOPT_PROTOCOLS_STR, CURLPROTO_HTTP | CURLPROTO_HTTPS); | 1046 | else |
1047 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https")); | ||
1048 | #else | ||
1049 | #ifdef CURLOPT_REDIR_PROTOCOLS | ||
1050 | if (0 == strncasecmp (current_url, "https://", strlen ("https://"))) | ||
1051 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS)); | ||
1052 | else | ||
1053 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS)); | ||
1054 | #endif | ||
1055 | #endif | ||
1056 | #ifdef CURLOPT_PROTOCOLS_STR | ||
1057 | if (0 == strncasecmp (current_url, "https://", strlen ("https://"))) | ||
1058 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_PROTOCOLS_STR, "https")); | ||
1059 | else | ||
1060 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_PROTOCOLS_STR, "http,https")); | ||
1061 | #else | ||
1062 | #ifdef CURLOPT_PROTOCOLS | ||
1063 | if (0 == strncasecmp (current_url, "https://", strlen ("https://"))) | ||
1064 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS)); | ||
1065 | else | ||
1066 | GNUNET_assert (CURLE_OK == curl_easy_setopt (curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS)); | ||
1067 | #endif | ||
1068 | #endif | ||
1047 | CURL_EASY_SETOPT (curl, CURLOPT_MAXREDIRS, 4); | 1069 | CURL_EASY_SETOPT (curl, CURLOPT_MAXREDIRS, 4); |
1048 | /* no need to abort if the above failed */ | 1070 | /* no need to abort if the above failed */ |
1049 | CURL_EASY_SETOPT (curl, CURLOPT_URL, current_url); | 1071 | CURL_EASY_SETOPT (curl, CURLOPT_URL, current_url); |