summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2023-01-10 23:20:41 +0100
committerMark Wielaard <mark@klomp.org>2023-01-10 23:20:41 +0100
commit6fdfac93c308707b4fa88b3b5be07359774f7073 (patch)
tree4e4eaff7c1a3aa18da5adbe143f6a247b24f7a77
parenta5b07cdf9c491fb7a4a16598c482c68b718f59b9 (diff)
downloadelfutils-users/mark/try-protocols_str.tar.gz
debuginfod-client: Use CURLOPT_PROTOCOLS_STR for libcurl >= 7.85.0users/mark/try-protocols_str
-rw-r--r--debuginfod/debuginfod-client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index a16165bd..1ce45632 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1336,8 +1336,13 @@ debuginfod_query_server (debuginfod_client *c,
/* Only allow http:// + https:// + file:// so we aren't being
redirected to some unsupported protocol. */
+#if CURL_AT_LEAST_VERSION(7, 85, 0)
+ curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS_STR,
+ "http,https,file");
+#else
curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS,
(CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE));
+#endif
curl_easy_setopt_ck(data[i].handle, CURLOPT_URL, data[i].url);
if (vfd >= 0)
curl_easy_setopt_ck(data[i].handle, CURLOPT_ERRORBUFFER,