config: move async_proxy out of experimental and enable
tested for hours on my git forge, lgtm
This commit is contained in:
@@ -40,11 +40,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
// experimental settings. Use with caution!
|
// If enabled, all requests to the proxy will create their own thread.
|
||||||
"experimental": {
|
// this can increase the throughput of the proxy, especially when there are a lot of requests made
|
||||||
// If enabled, all requests to the proxy will create their own thread.
|
// all at once.
|
||||||
// this can increase the throughput of the proxy, especially when there are a lot of requests made
|
"async_proxy": true
|
||||||
// all at once.
|
|
||||||
"async_proxy": false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -35,20 +35,17 @@ class CConfig {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct SConfig {
|
struct SConfig {
|
||||||
int port = 3001;
|
int port = 3001;
|
||||||
std::string forward_address = "127.0.0.1:3000";
|
std::string forward_address = "127.0.0.1:3000";
|
||||||
std::string data_dir = "";
|
std::string data_dir = "";
|
||||||
std::string html_dir = "";
|
std::string html_dir = "";
|
||||||
unsigned long int max_request_size = 10000000; // 10MB
|
unsigned long int max_request_size = 10000000; // 10MB
|
||||||
bool git_host = false;
|
bool git_host = false;
|
||||||
unsigned long int proxy_timeout_sec = 120; // 2 minutes
|
unsigned long int proxy_timeout_sec = 120; // 2 minutes
|
||||||
bool trace_logging = false;
|
bool trace_logging = false;
|
||||||
std::vector<SIPRangeConfig> ip_configs;
|
std::vector<SIPRangeConfig> ip_configs = {};
|
||||||
int default_challenge_difficulty = 4;
|
int default_challenge_difficulty = 4;
|
||||||
|
bool async_proxy = true;
|
||||||
struct {
|
|
||||||
bool async_proxy = false;
|
|
||||||
} experimental;
|
|
||||||
} m_config;
|
} m_config;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
@@ -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) {
|
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);
|
proxyPassAsync(req, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user