libstore(filetransfer): Support store-specific http-version setting
#14777
+176
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I'd like to allow more flexibility in selecting the HTTP version used for a specific store.
This PR refactors the logic for selecting the HTTP versions implemented by libcurl, which is currently controlled by the global
http2setting. Instead we add anhttp-versionsetting to the HTTP binary cache store. In addition to allowing experimentation with new protocols, this allows different stores to implement different HTTP versions.Backwards compatibility
When the store setting is
http-version == none(the default), the globalhttp2setting is checked:http2 == true(default) -> useCURL_HTTP_VERSION_NONE-- this differs from previous behavior usingCURL_HTTP_VERSION_2TLS, and lets curl decide the best version to use based on the scheme (http/https) and handshake.http2 == false-> useCURL_HTTP_VERSION_1_1(matching previous behavior)TLDR; users that have explicitly set
http2 == falsewill experience no change. The default behavior, however, is now usingCURL_HTTP_VERSION_NONErather thanCURL_HTTP_VERSION_TLS.One might also argue for the deprecation of the
http2setting at this point, and just let folks override directly withhttp-version=http1.1if they want it.Context
Some brief discussion around QUIC here.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.