From 5b929c9d1aee9e0ce4c16e86718c13e0c319f36c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 20 Nov 2022 03:51:44 +0100 Subject: [PATCH] Enable http/3 support --- CMakeLists.txt | 10 +++++----- io.github.NhekoReborn.Nheko.yaml | 6 +++--- src/MatrixClient.cpp | 9 ++++++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 302fad3f..3c9256c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "") diff --git a/io.github.NhekoReborn.Nheko.yaml b/io.github.NhekoReborn.Nheko.yaml index 69be7301..7f3aefc3 100644 --- a/io.github.NhekoReborn.Nheko.yaml +++ b/io.github.NhekoReborn.Nheko.yaml @@ -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 diff --git a/src/MatrixClient.cpp b/src/MatrixClient.cpp index e1c890ed..b5ea7609 100644 --- a/src/MatrixClient.cpp +++ b/src/MatrixClient.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include "nlohmann/json.hpp" @@ -33,7 +34,13 @@ namespace http { mtx::http::Client * client() { - static auto client_ = std::make_shared(); + static auto client_ = [] { + auto c = std::make_shared(); + c->alt_svc_cache_path((QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + + "/curl_alt_svc_cache.txt") + .toStdString()); + return c; + }(); return client_.get(); }