mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
* i2p::fs migration: I2PControl.*
This commit is contained in:
parent
6d74493491
commit
2b137b43e6
@ -13,6 +13,7 @@
|
|||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "FS.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "NetDb.h"
|
#include "NetDb.h"
|
||||||
@ -39,15 +40,12 @@ namespace client
|
|||||||
// certificate / keys
|
// certificate / keys
|
||||||
std::string i2pcp_crt; i2p::config::GetOption("i2pcontrol.cert", i2pcp_crt);
|
std::string i2pcp_crt; i2p::config::GetOption("i2pcontrol.cert", i2pcp_crt);
|
||||||
std::string i2pcp_key; i2p::config::GetOption("i2pcontrol.key", i2pcp_key);
|
std::string i2pcp_key; i2p::config::GetOption("i2pcontrol.key", i2pcp_key);
|
||||||
auto path = GetPath ();
|
|
||||||
// TODO: move this to i2p::fs::expand
|
|
||||||
if (i2pcp_crt.at(0) != '/')
|
if (i2pcp_crt.at(0) != '/')
|
||||||
i2pcp_crt.insert(0, (path / "/").string());
|
i2pcp_crt = i2p::fs::DataDirPath(i2pcp_crt);
|
||||||
if (i2pcp_key.at(0) != '/')
|
if (i2pcp_key.at(0) != '/')
|
||||||
i2pcp_key.insert(0, (path / "/").string());
|
i2pcp_key = i2p::fs::DataDirPath(i2pcp_key);
|
||||||
if (!boost::filesystem::exists (i2pcp_crt) ||
|
if (!i2p::fs::Exists (i2pcp_crt) || !i2p::fs::Exists (i2pcp_key)) {
|
||||||
!boost::filesystem::exists (i2pcp_key))
|
|
||||||
{
|
|
||||||
LogPrint (eLogInfo, "I2PControl: creating new certificate for control connection");
|
LogPrint (eLogInfo, "I2PControl: creating new certificate for control connection");
|
||||||
CreateCertificate (i2pcp_crt.c_str(), i2pcp_key.c_str());
|
CreateCertificate (i2pcp_crt.c_str(), i2pcp_key.c_str());
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/asio/ssl.hpp>
|
#include <boost/asio/ssl.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
{
|
{
|
||||||
@ -52,7 +50,6 @@ namespace client
|
|||||||
void HandleResponseSent (const boost::system::error_code& ecode, std::size_t bytes_transferred,
|
void HandleResponseSent (const boost::system::error_code& ecode, std::size_t bytes_transferred,
|
||||||
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf);
|
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf);
|
||||||
|
|
||||||
boost::filesystem::path GetPath () const { return i2p::util::filesystem::GetDefaultDataDir(); };
|
|
||||||
void CreateCertificate (const char *crt_path, const char *key_path);
|
void CreateCertificate (const char *crt_path, const char *key_path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user