fix: fixed disableSystemRoot option

This commit is contained in:
QxQ 2020-10-16 19:49:09 +08:00
parent 389b29d105
commit 1b00fc3e62
2 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
6011 6012

View File

@ -10,14 +10,14 @@ namespace Qv2ray::core::connection
QList<QPair<QString, CONFIGROOT>> ConvertConfigFromString(const QString &link, QString *aliasPrefix, QString *errMessage, QString *newGroup) QList<QPair<QString, CONFIGROOT>> ConvertConfigFromString(const QString &link, QString *aliasPrefix, QString *errMessage, QString *newGroup)
{ {
const auto TLSOptionsFilter = [](QJsonObject &conf) { const auto TLSOptionsFilter = [](QJsonObject &conf) {
auto allowInsecure = GlobalConfig.advancedConfig.setAllowInsecure; const auto allowInsecure = GlobalConfig.advancedConfig.setAllowInsecure;
auto setSR = GlobalConfig.advancedConfig.setSessionResumption; const auto setSR = GlobalConfig.advancedConfig.setSessionResumption;
auto disableSystemRoot = GlobalConfig.advancedConfig.disableSystemRoot; const auto disableSystemRoot = GlobalConfig.advancedConfig.disableSystemRoot;
for (const QString &prefix : { "tls", "xtls" }) for (const QString &prefix : { "tls", "xtls" })
{ {
QJsonIO::SetValue(conf, allowInsecure, { "outbounds", 0, "streamSettings", prefix + "Settings", "allowInsecure" }); QJsonIO::SetValue(conf, allowInsecure, { "outbounds", 0, "streamSettings", prefix + "Settings", "allowInsecure" });
QJsonIO::SetValue(conf, !setSR, { "outbounds", 0, "streamSettings", prefix + "Settings", "disableSessionResumption" }); QJsonIO::SetValue(conf, !setSR, { "outbounds", 0, "streamSettings", prefix + "Settings", "disableSessionResumption" });
QJsonIO::SetValue(conf, !disableSystemRoot, { "outbounds", 0, "streamSettings", prefix + "Settings", "disableSystemRoot" }); QJsonIO::SetValue(conf, disableSystemRoot, { "outbounds", 0, "streamSettings", prefix + "Settings", "disableSystemRoot" });
} }
}; };