Browse Source

* unwrap i2p::util::config::* calls in Daemon.cpp

pull/326/head
hagen 9 years ago
parent
commit
6740ec464c
  1. 17
      Daemon.cpp

17
Daemon.cpp

@ -120,8 +120,10 @@ namespace i2p
g_Log->SetLogLevel(i2p::util::config::GetArg("-loglevel", "info")); g_Log->SetLogLevel(i2p::util::config::GetArg("-loglevel", "info"));
} }
LogPrint(eLogInfo, "Daemon: staring HTTP Server"); std::string httpAddr = i2p::util::config::GetArg("-httpaddress", "127.0.0.1");
d.httpServer = std::unique_ptr<i2p::util::HTTPServer>(new i2p::util::HTTPServer(i2p::util::config::GetArg("-httpaddress", "127.0.0.1"), i2p::util::config::GetArg("-httpport", 7070))); uint16_t httpPort = i2p::util::config::GetArg("-httpport", 7070);
LogPrint(eLogInfo, "Daemon: staring HTTP Server at ", httpAddr, ":", httpPort);
d.httpServer = std::unique_ptr<i2p::util::HTTPServer>(new i2p::util::HTTPServer(httpAddr, httpPort));
d.httpServer->Start(); d.httpServer->Start();
LogPrint(eLogInfo, "Daemon: starting NetDB"); LogPrint(eLogInfo, "Daemon: starting NetDB");
@ -140,12 +142,13 @@ namespace i2p
LogPrint(eLogInfo, "Daemon: starting Client"); LogPrint(eLogInfo, "Daemon: starting Client");
i2p::client::context.Start (); i2p::client::context.Start ();
// I2P Control // I2P Control Protocol
int i2pcontrolPort = i2p::util::config::GetArg("-i2pcontrolport", 0); std::string i2pcpAddr = i2p::util::config::GetArg("-i2pcontroladdress", "127.0.0.1");
if (i2pcontrolPort) uint16_t i2pcpPort = i2p::util::config::GetArg("-i2pcontrolport", 0);
if (i2pcpPort)
{ {
LogPrint(eLogInfo, "Daemon: starting I2PControl"); LogPrint(eLogInfo, "Daemon: starting I2PControl at ", i2pcpAddr, ":", i2pcpPort);
d.m_I2PControlService = std::unique_ptr<i2p::client::I2PControlService>(new i2p::client::I2PControlService (i2p::util::config::GetArg("-i2pcontroladdress", "127.0.0.1"), i2pcontrolPort)); d.m_I2PControlService = std::unique_ptr<i2p::client::I2PControlService>(new i2p::client::I2PControlService (i2pcpAddr, i2pcpPort));
d.m_I2PControlService->Start (); d.m_I2PControlService->Start ();
} }
return true; return true;

Loading…
Cancel
Save