diff options
author | Mark Wielaard <mark@klomp.org> | 2023-01-10 23:20:41 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2023-01-11 15:13:24 +0100 |
commit | 6560fb26a62ef135a804357ef4f15a47de3e49b3 (patch) | |
tree | 697d817381349aa1b3ce7b9e2dab4a1f1efbb538 /debuginfod | |
parent | a5b07cdf9c491fb7a4a16598c482c68b718f59b9 (diff) | |
download | elfutils-6560fb26a62ef135a804357ef4f15a47de3e49b3.tar.gz |
debuginfod-client: Use CURLOPT_PROTOCOLS_STR for libcurl >= 7.85.0
https://sourceware.org/bugzilla/show_bug.cgi?id=29926
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'debuginfod')
-rw-r--r-- | debuginfod/ChangeLog | 5 | ||||
-rw-r--r-- | debuginfod/debuginfod-client.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 2ddb7ca0..8f9637f5 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,8 @@ +2023-01-10 Mark Wielaard <mark@klomp.org> + + * debuginfod-client.c (debuginfod_query_server): Use + CURL_AT_LEAST_VERSION(7.85.0) for CURLOPT_PROTOCOLS_STR. + 2022-12-21 Mark Wielaard <mark@klomp.org> * debuginfod-client.c: Define CURL_AT_LEAST_VERSION. 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, |