mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-06 03:32:14 +00:00
Enhancements
Fix a typo which cause the server to hang. Add option to enable reload pref config on request. Optimize codes.
This commit is contained in:
7 files changed
+26
-15
No files matched your search
@@ -323,7 +323,7 @@ std::string subconverter(RESPONSE_CALLBACK_ARGS)
|
||||
return "Invalid target!";
|
||||
}
|
||||
//check if we need to read configuration
|
||||
if((!global.APIMode || global.CFWChildProcess) && !global.generatorMode)
|
||||
if(global.reloadConfOnRequest && (!global.APIMode || global.CFWChildProcess) && !global.generatorMode)
|
||||
readConf();
|
||||
|
||||
/// string values
|
||||
|
||||
@@ -338,6 +338,7 @@ void readYAMLConf(YAML::Node &node)
|
||||
section["proxy_config"] >> global.proxyConfig;
|
||||
section["proxy_ruleset"] >> global.proxyRuleset;
|
||||
section["proxy_subscription"] >> global.proxySubscription;
|
||||
section["reload_conf_on_request"] >> global.reloadConfOnRequest;
|
||||
|
||||
if(node["userinfo"].IsDefined())
|
||||
{
|
||||
@@ -612,7 +613,8 @@ void readTOMLConf(toml::value &root)
|
||||
"proxy_config", global.proxyConfig,
|
||||
"proxy_ruleset", global.proxyRuleset,
|
||||
"proxy_subscription", global.proxySubscription,
|
||||
"append_proxy_type", global.appendType
|
||||
"append_proxy_type", global.appendType,
|
||||
"reload_conf_on_request", global.reloadConfOnRequest
|
||||
);
|
||||
|
||||
if(filter)
|
||||
@@ -854,6 +856,7 @@ void readConf()
|
||||
ini.get_if_exist("proxy_config", global.proxyConfig);
|
||||
ini.get_if_exist("proxy_ruleset", global.proxyRuleset);
|
||||
ini.get_if_exist("proxy_subscription", global.proxySubscription);
|
||||
ini.get_bool_if_exist("reload_conf_on_request", global.reloadConfOnRequest);
|
||||
|
||||
if(ini.section_exist("surge_external_proxy"))
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@ struct Settings
|
||||
std::string generateProfiles;
|
||||
|
||||
//preferences
|
||||
bool reloadConfOnRequest = false;
|
||||
RegexMatchConfigs renames, emojis;
|
||||
bool addEmoji = false, removeEmoji = false, appendType = false, filterDeprecated = true;
|
||||
tribool UDPFlag, TFOFlag, skipCertVerify, TLS13Flag, enableInsert;
|
||||
|
||||
Reference in new issue
Block a user