Optimize codes

Fix keeping UDP/TFO/Skip Cert Verify flags from original subscriptions not working.
Fix compiler warning.
This commit is contained in:
Tindy X committed 2020-06-08 20:41:02 +08:00
1 parent 64b5d3bdaa
commit 11ed400fc7
8 files changed
+46 -64

No files matched your search

+1 -18
View File
@@ -6,6 +6,7 @@
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
#include "yamlcpp_extra.h"
#include "misc.h"
#include "printout.h"
#include "logger.h"
@@ -26,24 +27,6 @@ std::string modSSMD5 = "f7653207090ce3389115e9c88541afe0";
//remake from speedtestutil
template <typename T> void operator >> (const YAML::Node& node, T& i)
{
if(node.IsDefined() && !node.IsNull()) //fail-safe
i = node.as<T>();
};
template <typename T> T safe_as (const YAML::Node& node)
{
if(node.IsDefined() && !node.IsNull())
return node.as<T>();
return T();
};
template <typename T> void operator >>= (const YAML::Node& node, T& i)
{
i = safe_as<T>(node);
};
void explodeVmess(std::string vmess, const std::string &custom_port, nodeInfo &node)
{
std::string version, ps, add, port, type, id, aid, net, path, host, tls;