From 595103b54ee7f30c61ca2343aff1e87a63e777c2 Mon Sep 17 00:00:00 2001 From: Qv2ray-dev <59914293+Qv2ray-dev@users.noreply.github.com> Date: Thu, 18 Jun 2020 00:29:27 +0800 Subject: [PATCH] update: some updates --- makespec/BUILDVERSION | 2 +- src/core/connection/serialization/vmess.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index 2c58feb1..a0096d78 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -5611 +5612 diff --git a/src/core/connection/serialization/vmess.cpp b/src/core/connection/serialization/vmess.cpp index 1edb2e99..4889e45a 100644 --- a/src/core/connection/serialization/vmess.cpp +++ b/src/core/connection/serialization/vmess.cpp @@ -62,6 +62,7 @@ namespace Qv2ray::core::connection auto vmessPart = Base64Encode(JsonToString(vmessUriRoot, QJsonDocument::JsonFormat::Compact)); return "vmess://" + vmessPart; } + // This generates global config containing only one outbound.... CONFIGROOT Deserialize(const QString &vmessStr, QString *alias, QString *errMessage) { @@ -195,7 +196,8 @@ namespace Qv2ray::core::connection path = vmessConf.contains("path") ? vmessConf["path"].toVariant().toString() : (net == "quic" ? "" : "/"); host = vmessConf.contains("host") ? vmessConf["host"].toVariant().toString() : (net == "quic" ? "none" : ""); } - // Repect connection type rather than obfs type // + + // Repect connection type rather than obfs type if (QStringList{ "srtp", "utp", "wechat-video" }.contains(type)) // { // if (net != "quic" && net != "kcp") // @@ -204,6 +206,7 @@ namespace Qv2ray::core::connection type = "none"; // } // } + port = vmessConf["port"].toVariant().toInt(); aid = vmessConf["aid"].toVariant().toInt(); // @@ -235,11 +238,11 @@ namespace Qv2ray::core::connection else if (net == "http" || net == "h2") { // Fill hosts for HTTP - for (auto _host : host.split(',')) + for (const auto &_host : host.split(',')) { if (!_host.isEmpty()) { - streaming.httpSettings.host.push_back(_host.trimmed()); + streaming.httpSettings.host << _host.trimmed(); } } @@ -291,5 +294,5 @@ namespace Qv2ray::core::connection return root; #undef default } - } // namespace Serialization::vmess + } // namespace serialization::vmess } // namespace Qv2ray::core::connection