Browse Source

- I2PControlService::LoadConfig : not used anymore

pull/358/head
hagen 9 years ago
parent
commit
928abf7094
  1. 28
      I2PControl.cpp
  2. 4
      I2PControl.h

28
I2PControl.cpp

@ -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)

4
I2PControl.h

@ -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…
Cancel
Save