From: Dylan Aïssi Date: Thu, 15 Jun 2023 12:29:47 +0000 (+0200) Subject: ostree-fetcher-curl: explicitly use HTTP1.1 when HTTP2 is disabled X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2~1^2~17^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d1ec6cdf8632f596da2fae8a105ca24724072bf7;p=ostree.git ostree-fetcher-curl: explicitly use HTTP1.1 when HTTP2 is disabled The current logic to select the HTTP version to be use relies on the fact that curl don't use by default HTTP2. This assumption seems wrong with recent versions of curl. Signed-off-by: Dylan Aïssi --- diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index d12d049a..9d07e5e1 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -879,6 +879,12 @@ initiate_next_curl_request (FetcherRequest *req, GTask *task) #endif } + if (self->config_flags & OSTREE_FETCHER_FLAGS_DISABLE_HTTP2) + { + rc = curl_easy_setopt (req->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + g_assert_cmpint (rc, ==, CURLM_OK); + } + rc = curl_easy_setopt (req->easy, CURLOPT_WRITEFUNCTION, write_cb); g_assert_cmpint (rc, ==, CURLM_OK); rc = curl_easy_setopt (req->easy, CURLOPT_HEADERFUNCTION, response_header_cb);