Fix http2 = false
having no effect.
#2977
Merged
+2
−0
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.
Fixes #2971.
Setting
http2 = false
in nix config (e.g. /etc/nix/nix.conf)had no effect, and
nix-env -vvvvv -i hello
still downloaded .narpackages using HTTP/2.
In
src/libstore/download.cc
, theCURL_HTTP_VERSION_2TLS
option wasbeing explicitly set when
downloadSettings.enableHttp2
wastrue
,but,
CURL_HTTP_VERSION_1_1
option was not being explicitly set whendownloadSettings.enableHttp2
wasfalse
.This may be because
https://curl.haxx.se/libcurl/c/libcurl-env.html
states:"You have to set this option if you want to use libcurl's HTTP/2 support."
but, also, in the changelog, states:
"DEFAULT
Since curl 7.62.0: CURL_HTTP_VERSION_2TLS
Before that: CURL_HTTP_VERSION_1_1"
So, the default setting for
libcurl
is HTTP/2 for version >= 7.62.0.In this commit, option
CURLOPT_HTTP_VERSION
is explicitly set toCURL_HTTP_VERSION_1_1
whendownloadSettings.enableHttp2
nix configsetting is
false
.This can be tested by running
nix-env -vvvvv -i hello | grep HTTP
cc with @nh2