libstore: warn if http3 && !http2

curl does not support this configuration. we can't easily change the
config setup to mirror how curl works, but we *can* print a warning.

fixes #1223

Change-Id: Iaa1583275d9cc9e5eed5552210db183a8e0628c8
This commit is contained in:
eldritch horrors
2026-06-08 12:47:19 +00:00
parent 0cad504c8a
commit daa2bc82bc
3 changed files with 9 additions and 0 deletions
@@ -5,3 +5,4 @@ type: bool
default: true
---
Whether to enable HTTP/2 support.
HTTP/2 support cannot be disabled if HTTP/3 support is enabled, the `http2` setting will be ignored in this case.
@@ -5,3 +5,4 @@ type: bool
default: false
---
Whether to enable HTTP/3 support.
Enabling HTTP/3 support forcibly enables HTTP/2 as well; the `http2` will be ignored in this case.
+7
View File
@@ -23,6 +23,7 @@
#include <kj/encoding.h>
#include <kj/time.h>
#include <memory>
#include <mutex>
#if ENABLE_DTRACE
#include "trace-probes.gen.hh"
@@ -196,6 +197,12 @@ struct TransferItem
);
curl_easy_setopt(req.get(), CURLOPT_PIPEWAIT, 1);
if (fileTransferSettings.enableHttp3) {
if (!fileTransferSettings.enableHttp2) {
static std::once_flag warningPrinted;
std::call_once(warningPrinted, [] {
printTaggedWarning("http3 implies http2; ignoring explicit http2 setting.");
});
}
curl_easy_setopt(req.get(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3);
} else if (fileTransferSettings.enableHttp2) {
curl_easy_setopt(req.get(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);