mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Fix annoying typo
This commit is contained in:
parent
420a52c4ea
commit
4fc582af96
3 changed files with 12 additions and 6 deletions
|
@ -7,6 +7,10 @@
|
|||
#include <util/logger.hpp>
|
||||
#include <util/mem.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
|
||||
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{});
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#ifndef LLARP_CONFIG_HPP
|
||||
#define LLARP_CONFIG_HPP
|
||||
|
||||
#include <forward_list>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue