2014-04-23 02:07:21 +04:00
|
|
|
#include <thread>
|
2015-11-03 17:15:49 +03:00
|
|
|
#include <memory>
|
2014-04-23 02:07:21 +04:00
|
|
|
|
2014-04-20 05:54:34 +04:00
|
|
|
#include "Daemon.h"
|
|
|
|
|
2016-01-20 03:00:00 +03:00
|
|
|
#include "Config.h"
|
2014-04-20 05:54:34 +04:00
|
|
|
#include "Log.h"
|
2016-02-11 03:00:00 +03:00
|
|
|
#include "FS.h"
|
2015-11-03 17:15:49 +03:00
|
|
|
#include "Base.h"
|
2014-10-17 19:42:05 +04:00
|
|
|
#include "version.h"
|
2014-04-20 05:54:34 +04:00
|
|
|
#include "Transports.h"
|
|
|
|
#include "NTCPSession.h"
|
|
|
|
#include "RouterInfo.h"
|
|
|
|
#include "RouterContext.h"
|
|
|
|
#include "Tunnel.h"
|
2016-04-27 03:00:00 +03:00
|
|
|
#include "HTTP.h"
|
2014-04-20 05:54:34 +04:00
|
|
|
#include "NetDb.h"
|
|
|
|
#include "Garlic.h"
|
|
|
|
#include "Streaming.h"
|
2014-10-05 16:54:59 +04:00
|
|
|
#include "Destination.h"
|
2014-04-23 02:07:21 +04:00
|
|
|
#include "HTTPServer.h"
|
2015-11-03 17:15:49 +03:00
|
|
|
#include "I2PControl.h"
|
2014-10-16 04:52:17 +04:00
|
|
|
#include "ClientContext.h"
|
2016-01-01 00:02:10 +03:00
|
|
|
#include "Crypto.h"
|
2015-11-03 17:15:49 +03:00
|
|
|
#include "UPnP.h"
|
2016-07-12 03:00:00 +03:00
|
|
|
#include "util.h"
|
2015-11-03 17:15:49 +03:00
|
|
|
|
2016-10-20 16:12:15 +03:00
|
|
|
#include "Event.h"
|
|
|
|
#include "Websocket.h"
|
|
|
|
|
2014-04-20 05:54:34 +04:00
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace util
|
|
|
|
{
|
2014-04-23 02:07:21 +04:00
|
|
|
class Daemon_Singleton::Daemon_Singleton_Private
|
2014-04-20 05:54:34 +04:00
|
|
|
{
|
2014-04-23 02:07:21 +04:00
|
|
|
public:
|
2015-11-03 17:15:49 +03:00
|
|
|
Daemon_Singleton_Private() {};
|
|
|
|
~Daemon_Singleton_Private() {};
|
2014-04-23 02:07:21 +04:00
|
|
|
|
2016-04-27 03:00:00 +03:00
|
|
|
std::unique_ptr<i2p::http::HTTPServer> httpServer;
|
2015-11-03 17:15:49 +03:00
|
|
|
std::unique_ptr<i2p::client::I2PControlService> m_I2PControlService;
|
2016-07-12 03:00:00 +03:00
|
|
|
std::unique_ptr<i2p::transport::UPnP> UPnP;
|
2016-10-20 16:28:03 +03:00
|
|
|
#ifdef WITH_EVENTS
|
2016-11-01 17:26:40 +03:00
|
|
|
std::unique_ptr<i2p::event::WebsocketServer> m_WebsocketServer;
|
2016-10-20 16:28:03 +03:00
|
|
|
#endif
|
2014-04-23 02:07:21 +04:00
|
|
|
};
|
|
|
|
|
2016-06-01 03:00:00 +03:00
|
|
|
Daemon_Singleton::Daemon_Singleton() : isDaemon(false), running(true), d(*new Daemon_Singleton_Private()) {}
|
2014-04-23 02:07:21 +04:00
|
|
|
Daemon_Singleton::~Daemon_Singleton() {
|
|
|
|
delete &d;
|
2016-06-01 03:00:00 +03:00
|
|
|
}
|
2014-04-23 02:07:21 +04:00
|
|
|
|
2014-10-17 17:55:41 +04:00
|
|
|
bool Daemon_Singleton::IsService () const
|
|
|
|
{
|
2016-01-20 03:00:00 +03:00
|
|
|
bool service = false;
|
2014-10-17 17:55:41 +04:00
|
|
|
#ifndef _WIN32
|
2016-01-20 03:00:00 +03:00
|
|
|
i2p::config::GetOption("service", service);
|
2014-10-17 17:55:41 +04:00
|
|
|
#endif
|
2016-01-20 03:00:00 +03:00
|
|
|
return service;
|
2014-10-17 17:55:41 +04:00
|
|
|
}
|
2014-04-23 02:07:21 +04:00
|
|
|
|
|
|
|
bool Daemon_Singleton::init(int argc, char* argv[])
|
|
|
|
{
|
2016-02-03 14:22:00 +03:00
|
|
|
i2p::config::Init();
|
|
|
|
i2p::config::ParseCmdline(argc, argv);
|
|
|
|
|
2016-02-11 03:00:00 +03:00
|
|
|
std::string config; i2p::config::GetOption("conf", config);
|
|
|
|
std::string datadir; i2p::config::GetOption("datadir", datadir);
|
|
|
|
i2p::fs::DetectDataDir(datadir, IsService());
|
|
|
|
i2p::fs::Init();
|
|
|
|
|
|
|
|
datadir = i2p::fs::GetDataDir();
|
2016-03-28 03:00:00 +03:00
|
|
|
// TODO: drop old name detection in v2.8.0
|
|
|
|
if (config == "")
|
2016-02-22 23:17:58 +03:00
|
|
|
{
|
|
|
|
config = i2p::fs::DataDirPath("i2p.conf");
|
2016-03-28 03:00:00 +03:00
|
|
|
if (i2p::fs::Exists (config)) {
|
|
|
|
LogPrint(eLogWarning, "Daemon: please rename i2p.conf to i2pd.conf here: ", config);
|
|
|
|
} else {
|
|
|
|
config = i2p::fs::DataDirPath("i2pd.conf");
|
|
|
|
if (!i2p::fs::Exists (config)) {
|
|
|
|
// use i2pd.conf only if exists
|
|
|
|
config = ""; /* reset */
|
|
|
|
}
|
|
|
|
}
|
2016-02-22 23:17:58 +03:00
|
|
|
}
|
2016-01-24 14:06:17 +03:00
|
|
|
|
|
|
|
i2p::config::ParseConfig(config);
|
2016-01-20 03:00:00 +03:00
|
|
|
i2p::config::Finalize();
|
|
|
|
|
|
|
|
i2p::config::GetOption("daemon", isDaemon);
|
2014-04-23 02:07:21 +04:00
|
|
|
|
2016-03-27 03:17:29 +03:00
|
|
|
std::string logs = ""; i2p::config::GetOption("log", logs);
|
|
|
|
std::string logfile = ""; i2p::config::GetOption("logfile", logfile);
|
|
|
|
std::string loglevel = ""; i2p::config::GetOption("loglevel", loglevel);
|
|
|
|
|
|
|
|
/* setup logging */
|
|
|
|
if (isDaemon && (logs == "" || logs == "stdout"))
|
|
|
|
logs = "file";
|
|
|
|
|
|
|
|
i2p::log::Logger().SetLogLevel(loglevel);
|
|
|
|
if (logs == "file") {
|
|
|
|
if (logfile == "")
|
|
|
|
logfile = i2p::fs::DataDirPath("i2pd.log");
|
|
|
|
LogPrint(eLogInfo, "Log: will send messages to ", logfile);
|
|
|
|
i2p::log::Logger().SendTo (logfile);
|
|
|
|
#ifndef _WIN32
|
|
|
|
} else if (logs == "syslog") {
|
|
|
|
LogPrint(eLogInfo, "Log: will send messages to syslog");
|
|
|
|
i2p::log::Logger().SendTo("i2pd", LOG_DAEMON);
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
// use stdout -- default
|
|
|
|
}
|
2016-02-03 14:22:00 +03:00
|
|
|
|
2016-06-29 18:06:51 +03:00
|
|
|
LogPrint(eLogInfo, "i2pd v", VERSION, " starting");
|
2016-02-03 14:22:00 +03:00
|
|
|
LogPrint(eLogDebug, "FS: main config file: ", config);
|
|
|
|
LogPrint(eLogDebug, "FS: data directory: ", datadir);
|
2014-04-20 05:54:34 +04:00
|
|
|
|
2016-04-17 23:57:58 +03:00
|
|
|
bool precomputation; i2p::config::GetOption("precomputation.elgamal", precomputation);
|
|
|
|
i2p::crypto::InitCrypto (precomputation);
|
2016-11-01 20:34:19 +03:00
|
|
|
|
|
|
|
int netID; i2p::config::GetOption("netid", netID);
|
|
|
|
i2p::context.SetNetID (netID);
|
2016-03-27 03:17:29 +03:00
|
|
|
i2p::context.Init ();
|
|
|
|
|
2016-06-29 18:06:51 +03:00
|
|
|
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
|
|
|
|
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
|
|
|
|
#ifdef MESHNET
|
|
|
|
// manual override for meshnet
|
|
|
|
ipv4 = false;
|
|
|
|
ipv6 = true;
|
|
|
|
#endif
|
2016-06-29 18:59:43 +03:00
|
|
|
uint16_t port; i2p::config::GetOption("port", port);
|
|
|
|
if (!i2p::config::IsDefault("port"))
|
2016-07-14 16:23:33 +03:00
|
|
|
{
|
2016-06-29 18:59:43 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: accepting incoming connections at port ", port);
|
|
|
|
i2p::context.UpdatePort (port);
|
2016-07-14 16:23:33 +03:00
|
|
|
}
|
2016-03-25 01:44:41 +03:00
|
|
|
i2p::context.SetSupportsV6 (ipv6);
|
|
|
|
i2p::context.SetSupportsV4 (ipv4);
|
2016-07-14 16:23:33 +03:00
|
|
|
|
|
|
|
bool transit; i2p::config::GetOption("notransit", transit);
|
2016-01-20 03:00:00 +03:00
|
|
|
i2p::context.SetAcceptsTunnels (!transit);
|
2016-04-20 21:53:50 +03:00
|
|
|
uint16_t transitTunnels; i2p::config::GetOption("limits.transittunnels", transitTunnels);
|
|
|
|
SetMaxNumTransitTunnels (transitTunnels);
|
2016-01-20 03:00:00 +03:00
|
|
|
|
|
|
|
bool isFloodfill; i2p::config::GetOption("floodfill", isFloodfill);
|
2016-03-31 03:00:00 +03:00
|
|
|
if (isFloodfill) {
|
2016-02-02 02:10:45 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: router will be floodfill");
|
2016-01-24 14:06:54 +03:00
|
|
|
i2p::context.SetFloodfill (true);
|
2016-03-31 03:00:00 +03:00
|
|
|
} else {
|
2016-02-11 15:50:29 +03:00
|
|
|
i2p::context.SetFloodfill (false);
|
2016-02-21 04:20:19 +03:00
|
|
|
}
|
2016-03-31 03:00:00 +03:00
|
|
|
|
|
|
|
/* this section also honors 'floodfill' flag, if set above */
|
|
|
|
std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
|
2016-03-31 04:31:17 +03:00
|
|
|
if (bandwidth.length () > 0)
|
|
|
|
{
|
|
|
|
if (bandwidth[0] >= 'K' && bandwidth[0] <= 'X')
|
|
|
|
{
|
|
|
|
i2p::context.SetBandwidth (bandwidth[0]);
|
|
|
|
LogPrint(eLogInfo, "Daemon: bandwidth set to ", i2p::context.GetBandwidthLimit (), "KBps");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
auto value = std::atoi(bandwidth.c_str());
|
|
|
|
if (value > 0)
|
|
|
|
{
|
|
|
|
i2p::context.SetBandwidth (value);
|
|
|
|
LogPrint(eLogInfo, "Daemon: bandwidth set to ", i2p::context.GetBandwidthLimit (), " KBps");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LogPrint(eLogInfo, "Daemon: unexpected bandwidth ", bandwidth, ". Set to 'low'");
|
|
|
|
i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_LOW_BANDWIDTH2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (isFloodfill)
|
|
|
|
{
|
|
|
|
LogPrint(eLogInfo, "Daemon: floodfill bandwidth set to 'extra'");
|
|
|
|
i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_EXTRA_BANDWIDTH1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LogPrint(eLogInfo, "Daemon: bandwidth set to 'low'");
|
|
|
|
i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_LOW_BANDWIDTH2);
|
|
|
|
}
|
2014-07-02 21:48:45 +04:00
|
|
|
|
2016-02-21 04:20:19 +03:00
|
|
|
std::string family; i2p::config::GetOption("family", family);
|
|
|
|
i2p::context.SetFamily (family);
|
|
|
|
if (family.length () > 0)
|
|
|
|
LogPrint(eLogInfo, "Daemon: family set to ", family);
|
2016-06-17 18:03:33 +03:00
|
|
|
|
|
|
|
bool trust; i2p::config::GetOption("trust.enabled", trust);
|
|
|
|
if (trust)
|
|
|
|
{
|
|
|
|
LogPrint(eLogInfo, "Daemon: explicit trust enabled");
|
|
|
|
std::string fam; i2p::config::GetOption("trust.family", fam);
|
2016-10-28 19:50:26 +03:00
|
|
|
std::string routers; i2p::config::GetOption("trust.routers", routers);
|
|
|
|
bool restricted = false;
|
2016-06-17 18:03:33 +03:00
|
|
|
if (fam.length() > 0)
|
|
|
|
{
|
2016-10-28 19:50:26 +03:00
|
|
|
std::set<std::string> fams;
|
|
|
|
size_t pos = 0, comma;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
comma = fam.find (',', pos);
|
|
|
|
fams.insert (fam.substr (pos, comma != std::string::npos ? comma - pos : std::string::npos));
|
|
|
|
pos = comma + 1;
|
|
|
|
}
|
|
|
|
while (comma != std::string::npos);
|
|
|
|
i2p::transport::transports.RestrictRoutesToFamilies(fams);
|
|
|
|
restricted = fams.size() > 0;
|
|
|
|
}
|
|
|
|
if (routers.length() > 0) {
|
|
|
|
std::set<i2p::data::IdentHash> idents;
|
|
|
|
size_t pos = 0, comma;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
comma = routers.find (',', pos);
|
|
|
|
i2p::data::IdentHash ident;
|
|
|
|
ident.FromBase64 (routers.substr (pos, comma != std::string::npos ? comma - pos : std::string::npos));
|
|
|
|
idents.insert (ident);
|
|
|
|
pos = comma + 1;
|
|
|
|
}
|
|
|
|
while (comma != std::string::npos);
|
|
|
|
LogPrint(eLogInfo, "Daemon: setting restricted routes to use ", idents.size(), " trusted routesrs");
|
|
|
|
i2p::transport::transports.RestrictRoutesToRouters(idents);
|
|
|
|
restricted = idents.size() > 0;
|
|
|
|
}
|
|
|
|
if(!restricted)
|
|
|
|
LogPrint(eLogError, "Daemon: no trusted routers of families specififed");
|
2016-06-18 18:10:58 +03:00
|
|
|
}
|
|
|
|
bool hidden; i2p::config::GetOption("trust.hidden", hidden);
|
|
|
|
if (hidden)
|
|
|
|
{
|
|
|
|
LogPrint(eLogInfo, "Daemon: using hidden mode");
|
|
|
|
i2p::data::netdb.SetHidden(true);
|
2016-06-17 18:03:33 +03:00
|
|
|
}
|
2016-06-28 20:28:57 +03:00
|
|
|
return true;
|
2014-07-02 21:48:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Daemon_Singleton::start()
|
|
|
|
{
|
2016-11-18 06:11:34 +03:00
|
|
|
i2p::log::Logger().Start();
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: starting NetDB");
|
2014-04-20 05:54:34 +04:00
|
|
|
i2p::data::netdb.Start();
|
2015-12-18 15:21:37 +03:00
|
|
|
|
2016-07-12 03:00:00 +03:00
|
|
|
bool upnp; i2p::config::GetOption("upnp.enabled", upnp);
|
|
|
|
if (upnp) {
|
|
|
|
d.UPnP = std::unique_ptr<i2p::transport::UPnP>(new i2p::transport::UPnP);
|
|
|
|
d.UPnP->Start ();
|
|
|
|
}
|
|
|
|
|
2016-06-30 21:24:55 +03:00
|
|
|
bool ntcp; i2p::config::GetOption("ntcp", ntcp);
|
|
|
|
bool ssu; i2p::config::GetOption("ssu", ssu);
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: starting Transports");
|
2016-07-14 16:23:33 +03:00
|
|
|
if(!ssu) LogPrint(eLogInfo, "Daemon: ssu disabled");
|
|
|
|
if(!ntcp) LogPrint(eLogInfo, "Daemon: ntcp disabled");
|
2016-06-17 16:02:12 +03:00
|
|
|
i2p::transport::transports.Start(ntcp, ssu);
|
2016-06-13 18:34:44 +03:00
|
|
|
if (i2p::transport::transports.IsBoundNTCP() || i2p::transport::transports.IsBoundSSU()) {
|
|
|
|
LogPrint(eLogInfo, "Daemon: Transports started");
|
|
|
|
} else {
|
|
|
|
LogPrint(eLogError, "Daemon: failed to start Transports");
|
|
|
|
/** shut down netdb right away */
|
2016-07-14 16:23:33 +03:00
|
|
|
i2p::transport::transports.Stop();
|
2016-06-13 18:34:44 +03:00
|
|
|
i2p::data::netdb.Stop();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool http; i2p::config::GetOption("http.enabled", http);
|
|
|
|
if (http) {
|
|
|
|
std::string httpAddr; i2p::config::GetOption("http.address", httpAddr);
|
|
|
|
uint16_t httpPort; i2p::config::GetOption("http.port", httpPort);
|
|
|
|
LogPrint(eLogInfo, "Daemon: starting HTTP Server at ", httpAddr, ":", httpPort);
|
|
|
|
d.httpServer = std::unique_ptr<i2p::http::HTTPServer>(new i2p::http::HTTPServer(httpAddr, httpPort));
|
|
|
|
d.httpServer->Start();
|
|
|
|
}
|
2015-12-18 15:21:37 +03:00
|
|
|
|
2016-06-13 18:34:44 +03:00
|
|
|
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: starting Tunnels");
|
2014-04-20 05:54:34 +04:00
|
|
|
i2p::tunnel::tunnels.Start();
|
2015-12-18 15:21:37 +03:00
|
|
|
|
|
|
|
LogPrint(eLogInfo, "Daemon: starting Client");
|
2014-10-16 04:52:17 +04:00
|
|
|
i2p::client::context.Start ();
|
2015-12-18 15:21:37 +03:00
|
|
|
|
2016-01-18 03:00:00 +03:00
|
|
|
// I2P Control Protocol
|
2016-01-20 03:00:00 +03:00
|
|
|
bool i2pcontrol; i2p::config::GetOption("i2pcontrol.enabled", i2pcontrol);
|
|
|
|
if (i2pcontrol) {
|
|
|
|
std::string i2pcpAddr; i2p::config::GetOption("i2pcontrol.address", i2pcpAddr);
|
|
|
|
uint16_t i2pcpPort; i2p::config::GetOption("i2pcontrol.port", i2pcpPort);
|
2016-01-18 03:00:00 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: starting I2PControl at ", i2pcpAddr, ":", i2pcpPort);
|
|
|
|
d.m_I2PControlService = std::unique_ptr<i2p::client::I2PControlService>(new i2p::client::I2PControlService (i2pcpAddr, i2pcpPort));
|
2015-11-03 17:15:49 +03:00
|
|
|
d.m_I2PControlService->Start ();
|
|
|
|
}
|
2016-10-20 16:28:03 +03:00
|
|
|
#ifdef WITH_EVENTS
|
2016-06-13 18:34:44 +03:00
|
|
|
|
2016-11-01 17:26:40 +03:00
|
|
|
bool websocket; i2p::config::GetOption("websockets.enabled", websocket);
|
|
|
|
if(websocket) {
|
|
|
|
std::string websocketAddr; i2p::config::GetOption("websockets.address", websocketAddr);
|
|
|
|
uint16_t websocketPort; i2p::config::GetOption("websockets.port", websocketPort);
|
2016-10-20 16:12:15 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: starting Websocket server at ", websocketAddr, ":", websocketPort);
|
|
|
|
d.m_WebsocketServer = std::unique_ptr<i2p::event::WebsocketServer>(new i2p::event::WebsocketServer (websocketAddr, websocketPort));
|
2016-11-01 17:26:40 +03:00
|
|
|
d.m_WebsocketServer->Start();
|
|
|
|
i2p::event::core.SetListener(d.m_WebsocketServer->ToListener());
|
|
|
|
}
|
|
|
|
#endif
|
2014-04-20 05:54:34 +04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Daemon_Singleton::stop()
|
|
|
|
{
|
2016-11-01 17:26:40 +03:00
|
|
|
#ifdef WITH_EVENTS
|
|
|
|
i2p::event::core.SetListener(nullptr);
|
|
|
|
#endif
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: shutting down");
|
|
|
|
LogPrint(eLogInfo, "Daemon: stopping Client");
|
2014-10-16 04:52:17 +04:00
|
|
|
i2p::client::context.Stop();
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: stopping Tunnels");
|
2014-04-20 05:54:34 +04:00
|
|
|
i2p::tunnel::tunnels.Stop();
|
2016-07-12 03:00:00 +03:00
|
|
|
|
|
|
|
if (d.UPnP) {
|
|
|
|
d.UPnP->Stop ();
|
|
|
|
d.UPnP = nullptr;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: stopping Transports");
|
2014-10-21 20:25:53 +04:00
|
|
|
i2p::transport::transports.Stop();
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: stopping NetDB");
|
2014-04-20 05:54:34 +04:00
|
|
|
i2p::data::netdb.Stop();
|
2016-02-03 14:30:00 +03:00
|
|
|
if (d.httpServer) {
|
|
|
|
LogPrint(eLogInfo, "Daemon: stopping HTTP Server");
|
|
|
|
d.httpServer->Stop();
|
|
|
|
d.httpServer = nullptr;
|
|
|
|
}
|
2015-11-03 17:15:49 +03:00
|
|
|
if (d.m_I2PControlService)
|
|
|
|
{
|
2015-12-18 15:21:37 +03:00
|
|
|
LogPrint(eLogInfo, "Daemon: stopping I2PControl");
|
2015-11-03 17:15:49 +03:00
|
|
|
d.m_I2PControlService->Stop ();
|
|
|
|
d.m_I2PControlService = nullptr;
|
2016-10-20 16:12:15 +03:00
|
|
|
}
|
2016-10-20 16:28:03 +03:00
|
|
|
#ifdef WITH_EVENTS
|
2016-11-01 17:26:40 +03:00
|
|
|
if (d.m_WebsocketServer) {
|
|
|
|
LogPrint(eLogInfo, "Daemon: stopping Websocket server");
|
|
|
|
d.m_WebsocketServer->Stop();
|
|
|
|
d.m_WebsocketServer = nullptr;
|
|
|
|
}
|
2016-10-20 16:28:03 +03:00
|
|
|
#endif
|
2016-01-01 00:02:10 +03:00
|
|
|
i2p::crypto::TerminateCrypto ();
|
2016-11-17 23:46:28 +03:00
|
|
|
i2p::log::Logger().Stop();
|
2014-08-14 18:20:22 +04:00
|
|
|
|
2014-04-20 05:54:34 +04:00
|
|
|
return true;
|
|
|
|
}
|
2016-11-01 17:26:40 +03:00
|
|
|
}
|
2014-04-23 02:37:24 +04:00
|
|
|
}
|