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 -7
View File
@@ -4,6 +4,7 @@
#include <inja.hpp>
#include <nlohmann/json.hpp>
#include "yamlcpp_extra.h"
#include "interfaces.h"
#include "templates.h"
#include "logger.h"
@@ -11,13 +12,6 @@
extern std::string managed_config_prefix;
template <typename T> T safe_as (const YAML::Node& node)
{
if(node.IsDefined() && !node.IsNull())
return node.as<T>();
return T();
};
static inline void parse_json_pointer(nlohmann::json &json, const std::string &path, const std::string &value)
{
std::string pointer = "/" + replace_all_distinct(path, ".", "/");