|
|
|
@ -55,26 +55,27 @@ namespace i2p
@@ -55,26 +55,27 @@ namespace i2p
|
|
|
|
|
i2p::context.OverrideNTCPAddress(i2p::util::config::GetCharArg("-host", "127.0.0.1"), |
|
|
|
|
i2p::util::config::GetArg("-port", 17007)); |
|
|
|
|
|
|
|
|
|
if (isLogging == 1) |
|
|
|
|
{ |
|
|
|
|
std::string logfile_path = i2p::util::filesystem::GetDataDir().string(); |
|
|
|
|
#ifndef _WIN32 |
|
|
|
|
logfile_path.append("/debug.log"); |
|
|
|
|
#else |
|
|
|
|
logfile_path.append("\\debug.log"); |
|
|
|
|
#endif |
|
|
|
|
g_Log.SetLogFile (logfile_path); |
|
|
|
|
|
|
|
|
|
LogPrint("CMD parameters:"); |
|
|
|
|
for (int i = 0; i < argc; ++i) |
|
|
|
|
LogPrint(i, " ", argv[i]); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Daemon_Singleton::start() |
|
|
|
|
{ |
|
|
|
|
// initialize log
|
|
|
|
|
if (isLogging) |
|
|
|
|
{ |
|
|
|
|
std::string logfile_path = i2p::util::filesystem::GetDataDir().string(); |
|
|
|
|
#ifndef _WIN32 |
|
|
|
|
logfile_path.append("/debug.log"); |
|
|
|
|
#else |
|
|
|
|
logfile_path.append("\\debug.log"); |
|
|
|
|
#endif |
|
|
|
|
StartLog (logfile_path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
d.httpServer = new i2p::util::HTTPServer(i2p::util::config::GetArg("-httpport", 7070)); |
|
|
|
|
d.httpServer->Start(); |
|
|
|
|
LogPrint("HTTPServer started"); |
|
|
|
@ -115,15 +116,11 @@ namespace i2p
@@ -115,15 +116,11 @@ namespace i2p
|
|
|
|
|
LogPrint("NetDB stoped"); |
|
|
|
|
d.httpServer->Stop(); |
|
|
|
|
LogPrint("HTTPServer stoped"); |
|
|
|
|
StopLog (); |
|
|
|
|
|
|
|
|
|
delete d.httpProxy; d.httpProxy = nullptr; |
|
|
|
|
delete d.httpServer; d.httpServer = nullptr; |
|
|
|
|
|
|
|
|
|
if (isLogging == 1) |
|
|
|
|
{ |
|
|
|
|
fclose(stdout); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|