mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 22:57:52 +00:00
- I2PControlService::LoadConfig : not used anymore
This commit is contained in:
parent
2cace0008e
commit
928abf7094
@ -35,7 +35,7 @@ namespace client
|
|||||||
m_ShutdownTimer (m_Service)
|
m_ShutdownTimer (m_Service)
|
||||||
{
|
{
|
||||||
GetOption("i2pcontrol.password", m_Password);
|
GetOption("i2pcontrol.password", m_Password);
|
||||||
LoadConfig ();
|
|
||||||
// certificate
|
// certificate
|
||||||
auto path = GetPath ();
|
auto path = GetPath ();
|
||||||
if (!boost::filesystem::exists (path))
|
if (!boost::filesystem::exists (path))
|
||||||
@ -87,32 +87,6 @@ namespace client
|
|||||||
Stop ();
|
Stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2PControlService::LoadConfig ()
|
|
||||||
{
|
|
||||||
auto path = GetPath ();
|
|
||||||
if (!boost::filesystem::exists (path))
|
|
||||||
{
|
|
||||||
if (!boost::filesystem::create_directory (path))
|
|
||||||
LogPrint (eLogError, "Failed to create i2pcontrol directory");
|
|
||||||
}
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
auto filename = path / I2P_CONTROL_CONFIG_FILE;
|
|
||||||
bool isNew = true;
|
|
||||||
if (boost::filesystem::exists (filename))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
boost::property_tree::read_ini (filename.string (), pt);
|
|
||||||
isNew = false;
|
|
||||||
}
|
|
||||||
catch (std::exception& ex)
|
|
||||||
{
|
|
||||||
LogPrint (eLogError, "Can't read ", filename, ": ", ex.what ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GetOption("i2pcontrol.password", m_Password);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlService::Start ()
|
void I2PControlService::Start ()
|
||||||
{
|
{
|
||||||
if (!m_IsRunning)
|
if (!m_IsRunning)
|
||||||
|
@ -81,9 +81,6 @@ namespace client
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void LoadConfig ();
|
|
||||||
void SaveConfig ();
|
|
||||||
|
|
||||||
void Run ();
|
void Run ();
|
||||||
void Accept ();
|
void Accept ();
|
||||||
void HandleAccept(const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> socket);
|
void HandleAccept(const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> socket);
|
||||||
@ -100,7 +97,6 @@ namespace client
|
|||||||
boost::filesystem::path GetPath () const { return i2p::util::filesystem::GetDefaultDataDir() / I2P_CONTROL_PATH; };
|
boost::filesystem::path GetPath () const { return i2p::util::filesystem::GetDefaultDataDir() / I2P_CONTROL_PATH; };
|
||||||
void CreateCertificate ();
|
void CreateCertificate ();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void InsertParam (std::ostringstream& ss, const std::string& name, int value) const;
|
void InsertParam (std::ostringstream& ss, const std::string& name, int value) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user