Enable http/3 support

This commit is contained in:
Nicolas Werner 2022-11-20 03:51:44 +01:00
parent 30bbfeaea6
commit 5b929c9d1a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 16 additions and 9 deletions

View file

@ -25,9 +25,9 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "compile as PIC by default")
option(HUNTER_ENABLED "Enable Hunter package manager" OFF)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.3.tar.gz"
SHA1 "10738b59e539818a01090e64c2d09896247530c7"
LOCAL
URL "https://github.com/cpp-pm/hunter/archive/v0.24.8.tar.gz"
SHA1 "ca7838dded9a1811b04ffd56175f629e0af82d3d"
LOCAL
)
macro(hunter_add_package_safe)
@ -186,7 +186,7 @@ if(USE_BUNDLED_COEURL)
FetchContent_Declare(
coeurl
GIT_REPOSITORY https://nheko.im/Nheko-Reborn/coeurl.git
GIT_TAG v0.2.1
GIT_TAG f989f3c54c1ca15e29c5bd6b1ce4efbcb3fd8078
)
FetchContent_MakeAvailable(coeurl)
set(COEURL_TARGET_NAME coeurl::coeurl)
@ -595,7 +595,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare(
MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
GIT_TAG a1b7b81ce00ef5808eac0fdd895a95044e1b07ed
GIT_TAG c7a13e79289ae35c4e2a9bccb3fdeb2bc03a925d
)
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")

View file

@ -170,8 +170,8 @@ modules:
- -Ddefault_library=static
name: coeurl
sources:
- commit: cfeae3acef061dbb19706f462ee58b9be2e6ec76
tag: v0.2.1
- commit: f989f3c54c1ca15e29c5bd6b1ce4efbcb3fd8078
#tag: v0.2.1
type: git
url: https://nheko.im/nheko-reborn/coeurl.git
- config-opts:
@ -182,7 +182,7 @@ modules:
buildsystem: cmake-ninja
name: mtxclient
sources:
- commit: a1b7b81ce00ef5808eac0fdd895a95044e1b07ed
- commit: c7a13e79289ae35c4e2a9bccb3fdeb2bc03a925d
#tag: v0.8.2
type: git
url: https://github.com/Nheko-Reborn/mtxclient.git

View file

@ -10,6 +10,7 @@
#include <QMetaType>
#include <QObject>
#include <QStandardPaths>
#include <QString>
#include "nlohmann/json.hpp"
@ -33,7 +34,13 @@ namespace http {
mtx::http::Client *
client()
{
static auto client_ = std::make_shared<mtx::http::Client>();
static auto client_ = [] {
auto c = std::make_shared<mtx::http::Client>();
c->alt_svc_cache_path((QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
"/curl_alt_svc_cache.txt")
.toStdString());
return c;
}();
return client_.get();
}