http: negotiation and room for alt-svc/https rr to navigate

Add a 'wanted' major HTTP version bitmask next to the 'allowed' bitmask
in HTTP version negotiation. This will try connections as specified in
'wanted', but enabled Alt-Svc and HTTPS-RR to redirect to other major
HTTP versions, if those are 'allowed'.

Changes libcurl internal default to `CURL_HTTP_VERSION_NONE` and removes
the code in curl that sets `CURL_HTTP_VERSION_2TLS` if the command line
does not say anything else.

Closes #16117
This commit is contained in:
Stefan Eissing 2025-01-28 14:11:59 +01:00 committed by Daniel Stenberg
parent a1850ad7de
commit 279a4772ae
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 143 additions and 96 deletions

View file

@ -1087,8 +1087,6 @@ static CURLcode config2setopts(struct GlobalConfig *global,
if(config->httpversion)
my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion);
else if(feature_http2)
my_setopt_enum(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
/* curl 7.19.1 (the 301 version existed in 7.18.2),
303 was added in 7.26.0 */