From 4cba4eb3f122c7a1a49b629b1c0656d7f817f001 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 24 Oct 2025 19:32:01 +0200 Subject: move cpr in-tree (#605) * added cpr 1.10.5 in-tree to allow updates to vcpkg without breaking the build * added asio 1.29.0 in-tree to remove one more vcpkg dependency * bumped vcpkg to 2024.06.15 to address failure to build due to use of deprecated binaries in vcpkg (404 error: `https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst` during build) --- thirdparty/cpr/test/httpsServer.hpp | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 thirdparty/cpr/test/httpsServer.hpp (limited to 'thirdparty/cpr/test/httpsServer.hpp') diff --git a/thirdparty/cpr/test/httpsServer.hpp b/thirdparty/cpr/test/httpsServer.hpp new file mode 100644 index 000000000..cea4d3438 --- /dev/null +++ b/thirdparty/cpr/test/httpsServer.hpp @@ -0,0 +1,42 @@ +#ifndef CPR_TEST_HTTPS_SERVER_H +#define CPR_TEST_HTTPS_SERVER_H + +#include +#include + +#include "abstractServer.hpp" +#include "cpr/cpr.h" +#include "mongoose.h" +#include + +namespace cpr { +class HttpsServer : public AbstractServer { + private: + // We don't use fs::path here, as this leads to problems using windows + const std::string baseDirPath; + const std::string sslCertFileName; + const std::string sslKeyFileName; + struct mg_tls_opts tlsOpts; + + public: + explicit HttpsServer(fs::path&& baseDirPath, fs::path&& sslCertFileName, fs::path&& sslKeyFileName); + ~HttpsServer() override = default; + + std::string GetBaseUrl() override; + uint16_t GetPort() override; + + void OnRequest(mg_connection* conn, mg_http_message* msg) override; + static void OnRequestHello(mg_connection* conn, mg_http_message* msg); + static void OnRequestNotFound(mg_connection* conn, mg_http_message* msg); + + const std::string& getBaseDirPath() const; + const std::string& getSslCertFileName() const; + const std::string& getSslKeyFileName() const; + + protected: + mg_connection* initServer(mg_mgr* mgr, mg_event_handler_t event_handler) override; + void acceptConnection(mg_connection* conn) override; +}; +} // namespace cpr + +#endif -- cgit v1.2.3