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 <dylan.aissi@collabora.com>
This commit is contained in:
Dylan Aïssi 2023-06-15 14:29:47 +02:00
parent ff805f1c4f
commit d1ec6cdf86

View File

@ -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);