|
|
@ -3,7 +3,7 @@ |
|
|
|
#include <boost/property_tree/ptree.hpp> |
|
|
|
#include <boost/property_tree/ptree.hpp> |
|
|
|
#include <boost/property_tree/ini_parser.hpp> |
|
|
|
#include <boost/property_tree/ini_parser.hpp> |
|
|
|
#include "Config.h" |
|
|
|
#include "Config.h" |
|
|
|
#include "util.h" |
|
|
|
#include "FS.h" |
|
|
|
#include "Log.h" |
|
|
|
#include "Log.h" |
|
|
|
#include "Identity.h" |
|
|
|
#include "Identity.h" |
|
|
|
#include "ClientContext.h" |
|
|
|
#include "ClientContext.h" |
|
|
@ -152,10 +152,10 @@ namespace client |
|
|
|
m_SharedLocalDestination = nullptr; |
|
|
|
m_SharedLocalDestination = nullptr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ClientContext::LoadPrivateKeys (i2p::data::PrivateKeys& keys, const std::string& filename, i2p::data::SigningKeyType sigType) |
|
|
|
void ClientContext::LoadPrivateKeys (i2p::data::PrivateKeys& keys, const std::string& filename, i2p::data::SigningKeyType sigType) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string fullPath = i2p::util::filesystem::GetFullPath (filename); |
|
|
|
std::string fullPath = i2p::fs::DataDirPath (filename); |
|
|
|
std::ifstream s(fullPath.c_str (), std::ifstream::binary); |
|
|
|
std::ifstream s(fullPath, std::ifstream::binary); |
|
|
|
if (s.is_open ()) |
|
|
|
if (s.is_open ()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
s.seekg (0, std::ios::end); |
|
|
|
s.seekg (0, std::ios::end); |
|
|
@ -256,14 +256,14 @@ namespace client |
|
|
|
void ClientContext::ReadTunnels () |
|
|
|
void ClientContext::ReadTunnels () |
|
|
|
{ |
|
|
|
{ |
|
|
|
boost::property_tree::ptree pt; |
|
|
|
boost::property_tree::ptree pt; |
|
|
|
std::string pathTunnelsConfigFile = i2p::util::filesystem::GetTunnelsConfigFile().string(); |
|
|
|
std::string pathTunConf; |
|
|
|
try |
|
|
|
i2p::config::GetOption("tunconf", pathTunConf); |
|
|
|
{ |
|
|
|
if (pathTunConf == "") |
|
|
|
boost::property_tree::read_ini (pathTunnelsConfigFile, pt); |
|
|
|
return; |
|
|
|
} |
|
|
|
try { |
|
|
|
catch (std::exception& ex) |
|
|
|
boost::property_tree::read_ini (pathTunConf, pt); |
|
|
|
{ |
|
|
|
} catch (std::exception& ex) { |
|
|
|
LogPrint (eLogWarning, "Clients: Can't read ", pathTunnelsConfigFile, ": ", ex.what ()); |
|
|
|
LogPrint (eLogWarning, "Clients: Can't read ", pathTunConf, ": ", ex.what ()); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -351,7 +351,7 @@ namespace client |
|
|
|
numServerTunnels++; |
|
|
|
numServerTunnels++; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
LogPrint (eLogWarning, "Clients: Unknown section type=", type, " of ", name, " in ", pathTunnelsConfigFile); |
|
|
|
LogPrint (eLogWarning, "Clients: Unknown section type=", type, " of ", name, " in ", pathTunConf); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
catch (std::exception& ex) |
|
|
|
catch (std::exception& ex) |
|
|
|