From 01998444c01c7e4fb0ca46c2086742c792573f4d Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 15 Apr 2025 23:32:56 +0100 Subject: [PATCH] config: move async_proxy out of experimental and enable tested for hours on my git forge, lgtm --- example/config.jsonc | 11 ++++------- src/config/Config.hpp | 23 ++++++++++------------- src/core/Handler.cpp | 2 +- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/example/config.jsonc b/example/config.jsonc index 51f538e..fafede6 100644 --- a/example/config.jsonc +++ b/example/config.jsonc @@ -40,11 +40,8 @@ } ], - // experimental settings. Use with caution! - "experimental": { - // If enabled, all requests to the proxy will create their own thread. - // this can increase the throughput of the proxy, especially when there are a lot of requests made - // all at once. - "async_proxy": false - } + // If enabled, all requests to the proxy will create their own thread. + // this can increase the throughput of the proxy, especially when there are a lot of requests made + // all at once. + "async_proxy": true } \ No newline at end of file diff --git a/src/config/Config.hpp b/src/config/Config.hpp index bb12083..a830d28 100644 --- a/src/config/Config.hpp +++ b/src/config/Config.hpp @@ -35,20 +35,17 @@ class CConfig { }; struct SConfig { - int port = 3001; - std::string forward_address = "127.0.0.1:3000"; - std::string data_dir = ""; - std::string html_dir = ""; - unsigned long int max_request_size = 10000000; // 10MB - bool git_host = false; - unsigned long int proxy_timeout_sec = 120; // 2 minutes - bool trace_logging = false; - std::vector ip_configs; + int port = 3001; + std::string forward_address = "127.0.0.1:3000"; + std::string data_dir = ""; + std::string html_dir = ""; + unsigned long int max_request_size = 10000000; // 10MB + bool git_host = false; + unsigned long int proxy_timeout_sec = 120; // 2 minutes + bool trace_logging = false; + std::vector ip_configs = {}; int default_challenge_difficulty = 4; - - struct { - bool async_proxy = false; - } experimental; + bool async_proxy = true; } m_config; struct { diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index 1cedb60..0570774 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -360,7 +360,7 @@ void CServerHandler::serveStop(const Pistache::Http::Request& req, Pistache::Htt } void CServerHandler::proxyPass(const Pistache::Http::Request& req, Pistache::Http::ResponseWriter& response) { - if (g_pConfig->m_config.experimental.async_proxy) { + if (g_pConfig->m_config.async_proxy) { proxyPassAsync(req, response); return; }