|
|
|
@ -513,6 +513,7 @@ namespace http {
@@ -513,6 +513,7 @@ namespace http {
|
|
|
|
|
s << " <a href=/?cmd=" << HTTP_COMMAND_STOP_ACCEPTING_TUNNELS << ">Stop accepting tunnels</a><br>\r\n"; |
|
|
|
|
else |
|
|
|
|
s << " <a href=/?cmd=" << HTTP_COMMAND_START_ACCEPTING_TUNNELS << ">Start accepting tunnels</a><br>\r\n"; |
|
|
|
|
#ifndef WIN32 |
|
|
|
|
if (Daemon.gracefullShutdownInterval) { |
|
|
|
|
s << " <a href=/?cmd=" << HTTP_COMMAND_SHUTDOWN_CANCEL << ">Cancel gracefull shutdown ("; |
|
|
|
|
s << Daemon.gracefullShutdownInterval; |
|
|
|
@ -521,6 +522,7 @@ namespace http {
@@ -521,6 +522,7 @@ namespace http {
|
|
|
|
|
s << " <a href=/?cmd=" << HTTP_COMMAND_SHUTDOWN_START << ">Start gracefull shutdown</a><br>\r\n"; |
|
|
|
|
} |
|
|
|
|
s << " <a href=/?cmd=" << HTTP_COMMAND_SHUTDOWN_NOW << ">Force shutdown</a><br>\r\n"; |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ShowTransitTunnels (std::stringstream& s) |
|
|
|
@ -818,10 +820,14 @@ namespace http {
@@ -818,10 +820,14 @@ namespace http {
|
|
|
|
|
i2p::context.SetAcceptsTunnels (false); |
|
|
|
|
else if (cmd == HTTP_COMMAND_SHUTDOWN_START) { |
|
|
|
|
i2p::context.SetAcceptsTunnels (false); |
|
|
|
|
#ifndef WIN32 |
|
|
|
|
Daemon.gracefullShutdownInterval = 10*60; |
|
|
|
|
#endif |
|
|
|
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_CANCEL) { |
|
|
|
|
i2p::context.SetAcceptsTunnels (true); |
|
|
|
|
#ifndef WIN32 |
|
|
|
|
Daemon.gracefullShutdownInterval = 0; |
|
|
|
|
#endif |
|
|
|
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) { |
|
|
|
|
Daemon.running = false; |
|
|
|
|
} else { |
|
|
|
|