mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
windows doesn't support graceful shutdown yet
This commit is contained in:
parent
3907b4101a
commit
ae81cc2644
@ -513,6 +513,7 @@ namespace http {
|
|||||||
s << " <a href=/?cmd=" << HTTP_COMMAND_STOP_ACCEPTING_TUNNELS << ">Stop accepting tunnels</a><br>\r\n";
|
s << " <a href=/?cmd=" << HTTP_COMMAND_STOP_ACCEPTING_TUNNELS << ">Stop accepting tunnels</a><br>\r\n";
|
||||||
else
|
else
|
||||||
s << " <a href=/?cmd=" << HTTP_COMMAND_START_ACCEPTING_TUNNELS << ">Start accepting tunnels</a><br>\r\n";
|
s << " <a href=/?cmd=" << HTTP_COMMAND_START_ACCEPTING_TUNNELS << ">Start accepting tunnels</a><br>\r\n";
|
||||||
|
#ifndef WIN32
|
||||||
if (Daemon.gracefullShutdownInterval) {
|
if (Daemon.gracefullShutdownInterval) {
|
||||||
s << " <a href=/?cmd=" << HTTP_COMMAND_SHUTDOWN_CANCEL << ">Cancel gracefull shutdown (";
|
s << " <a href=/?cmd=" << HTTP_COMMAND_SHUTDOWN_CANCEL << ">Cancel gracefull shutdown (";
|
||||||
s << Daemon.gracefullShutdownInterval;
|
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_START << ">Start gracefull shutdown</a><br>\r\n";
|
||||||
}
|
}
|
||||||
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";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowTransitTunnels (std::stringstream& s)
|
void ShowTransitTunnels (std::stringstream& s)
|
||||||
@ -818,10 +820,14 @@ namespace http {
|
|||||||
i2p::context.SetAcceptsTunnels (false);
|
i2p::context.SetAcceptsTunnels (false);
|
||||||
else if (cmd == HTTP_COMMAND_SHUTDOWN_START) {
|
else if (cmd == HTTP_COMMAND_SHUTDOWN_START) {
|
||||||
i2p::context.SetAcceptsTunnels (false);
|
i2p::context.SetAcceptsTunnels (false);
|
||||||
|
#ifndef WIN32
|
||||||
Daemon.gracefullShutdownInterval = 10*60;
|
Daemon.gracefullShutdownInterval = 10*60;
|
||||||
|
#endif
|
||||||
} else if (cmd == HTTP_COMMAND_SHUTDOWN_CANCEL) {
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_CANCEL) {
|
||||||
i2p::context.SetAcceptsTunnels (true);
|
i2p::context.SetAcceptsTunnels (true);
|
||||||
|
#ifndef WIN32
|
||||||
Daemon.gracefullShutdownInterval = 0;
|
Daemon.gracefullShutdownInterval = 0;
|
||||||
|
#endif
|
||||||
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) {
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) {
|
||||||
Daemon.running = false;
|
Daemon.running = false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user