|
|
@ -196,7 +196,7 @@ namespace http { |
|
|
|
} |
|
|
|
} |
|
|
|
s << "<br>\r\n"; |
|
|
|
s << "<br>\r\n"; |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
if (auto remains = Daemon.gracefullShutdownInterval) { |
|
|
|
if (auto remains = Daemon.gracefulShutdownInterval) { |
|
|
|
s << "<b>Stopping in:</b> "; |
|
|
|
s << "<b>Stopping in:</b> "; |
|
|
|
s << remains << " seconds"; |
|
|
|
s << remains << " seconds"; |
|
|
|
s << "<br>\r\n"; |
|
|
|
s << "<br>\r\n"; |
|
|
@ -416,13 +416,13 @@ namespace http { |
|
|
|
else |
|
|
|
else |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_ENABLE_TRANSIT << "\">Accept transit tunnels</a><br>\r\n"; |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_ENABLE_TRANSIT << "\">Accept transit tunnels</a><br>\r\n"; |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
if (Daemon.gracefullShutdownInterval) |
|
|
|
if (Daemon.gracefulShutdownInterval) |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_CANCEL << "\">Cancel gracefull shutdown</a><br>"; |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_CANCEL << "\">Cancel graceful shutdown</a><br>"; |
|
|
|
else |
|
|
|
else |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_START << "\">Start gracefull shutdown</a><br>\r\n"; |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_START << "\">Start graceful shutdown</a><br>\r\n"; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef WIN32_APP |
|
|
|
#ifdef WIN32_APP |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_START << "\">Gracefull shutdown</a><br>\r\n"; |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_START << "\">Graceful shutdown</a><br>\r\n"; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_NOW << "\">Force shutdown</a><br>\r\n"; |
|
|
|
s << " <a href=\"/?cmd=" << HTTP_COMMAND_SHUTDOWN_NOW << "\">Force shutdown</a><br>\r\n"; |
|
|
|
} |
|
|
|
} |
|
|
@ -755,7 +755,7 @@ namespace http { |
|
|
|
else if (cmd == HTTP_COMMAND_SHUTDOWN_START) { |
|
|
|
else if (cmd == HTTP_COMMAND_SHUTDOWN_START) { |
|
|
|
i2p::context.SetAcceptsTunnels (false); |
|
|
|
i2p::context.SetAcceptsTunnels (false); |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
Daemon.gracefullShutdownInterval = 10*60; |
|
|
|
Daemon.gracefulShutdownInterval = 10*60; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef WIN32_APP |
|
|
|
#ifdef WIN32_APP |
|
|
|
i2p::win32::GracefulShutdown (); |
|
|
|
i2p::win32::GracefulShutdown (); |
|
|
@ -763,7 +763,7 @@ namespace http { |
|
|
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_CANCEL) { |
|
|
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_CANCEL) { |
|
|
|
i2p::context.SetAcceptsTunnels (true); |
|
|
|
i2p::context.SetAcceptsTunnels (true); |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
#if (!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) |
|
|
|
Daemon.gracefullShutdownInterval = 0; |
|
|
|
Daemon.gracefulShutdownInterval = 0; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) { |
|
|
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) { |
|
|
|
Daemon.running = false; |
|
|
|
Daemon.running = false; |
|
|
|