summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgit-bruh <e817509a-8ee9-4332-b0ad-3a6bdf9ab63f@aleeas.com>2022-09-03 12:50:00 +0530
committergit-bruh <e817509a-8ee9-4332-b0ad-3a6bdf9ab63f@aleeas.com>2022-09-03 12:50:00 +0530
commit35d6ea88f65724a8fb960245647786916433fc93 (patch)
treefd968c9c1edb8977b83241dba491ed6d591728f5
parenteed9e9f335eeddb6cd648239daa23e99b93f9d41 (diff)
downloadostree-35d6ea88f65724a8fb960245647786916433fc93.tar.gz
ostree-fetcher-curl: check for HTTP2 support before trying to use it
-rw-r--r--src/libostree/ostree-fetcher-curl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c
index 75038ecc..522eacfb 100644
--- a/src/libostree/ostree-fetcher-curl.c
+++ b/src/libostree/ostree-fetcher-curl.c
@@ -882,8 +882,10 @@ initiate_next_curl_request (FetcherRequest *req,
if (!(self->config_flags & OSTREE_FETCHER_FLAGS_DISABLE_HTTP2))
{
#if CURL_AT_LEAST_VERSION(7, 51, 0)
- rc = curl_easy_setopt (req->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
- g_assert_cmpint (rc, ==, CURLM_OK);
+ if ((curl_version_info (CURLVERSION_NOW))->features & CURL_VERSION_HTTP2) {
+ rc = curl_easy_setopt (req->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
+ g_assert_cmpint (rc, ==, CURLM_OK);
+ }
#endif
/* https://github.com/curl/curl/blob/curl-7_53_0/docs/examples/http2-download.c */
#if (CURLPIPE_MULTIPLEX > 0)