From 4fc582af969c057940a1f0a3731b105d9e7d2698 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 12 Feb 2019 00:33:19 +0000 Subject: [PATCH] Fix annoying typo --- llarp/config.cpp | 8 +++++++- llarp/config.hpp | 8 ++++---- llarp/context.cpp | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/llarp/config.cpp b/llarp/config.cpp index 52b6c257c..490ac2a38 100644 --- a/llarp/config.cpp +++ b/llarp/config.cpp @@ -7,6 +7,10 @@ #include #include +#include +#include +#include + namespace llarp { template < typename Config, typename Section > @@ -18,7 +22,7 @@ namespace llarp [&ret](const ConfigParser::Section_t &s) -> bool { for(const auto &item : s) { - ret.emplace_after(ret.end(), item.first, item.second); + ret.emplace_back(item.first, item.second); } return true; })) @@ -32,7 +36,9 @@ namespace llarp { ConfigParser parser; if(!parser.LoadFile(fname)) + { return false; + } router = find_section(parser, "router", section_t{}); network = find_section(parser, "network", section_t{}); connect = find_section(parser, "connect", section_t{}); diff --git a/llarp/config.hpp b/llarp/config.hpp index 93ad42aca..7cc203c40 100644 --- a/llarp/config.hpp +++ b/llarp/config.hpp @@ -1,16 +1,16 @@ #ifndef LLARP_CONFIG_HPP #define LLARP_CONFIG_HPP -#include -#include #include +#include +#include +#include namespace llarp { struct Config { - using section_t = - std::forward_list< std::pair< std::string, std::string > >; + using section_t = std::vector< std::pair< std::string, std::string > >; section_t router; section_t network; diff --git a/llarp/context.cpp b/llarp/context.cpp index 6c8d815c7..c76f2753a 100644 --- a/llarp/context.cpp +++ b/llarp/context.cpp @@ -38,7 +38,7 @@ namespace llarp Context::Configure() { // llarp::LogInfo("loading config at ", configfile); - if(config->Load(configfile.c_str())) + if(!config->Load(configfile.c_str())) { config.release(); llarp::LogError("failed to load config file ", configfile);