windows doesn't support graceful shutdown yet

This commit is contained in:
orignal 2016-05-11 15:33:53 -04:00
parent 3907b4101a
commit ae81cc2644

View File

@ -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 {
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 {
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 {