mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
fix shutdown from webconsole in windows
This commit is contained in:
parent
7a857e08c1
commit
dde4643e77
2 changed files with 11 additions and 4 deletions
|
@ -368,6 +368,9 @@ namespace win32
|
||||||
|
|
||||||
void StopWin32App ()
|
void StopWin32App ()
|
||||||
{
|
{
|
||||||
|
HWND hWnd = FindWindow (I2PD_WIN32_CLASSNAME, TEXT("i2pd"));
|
||||||
|
if (hWnd)
|
||||||
|
PostMessage (hWnd, WM_COMMAND, MAKEWPARAM(ID_EXIT, 0), 0);
|
||||||
UnregisterClass (I2PD_WIN32_CLASSNAME, GetModuleHandle(NULL));
|
UnregisterClass (I2PD_WIN32_CLASSNAME, GetModuleHandle(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -908,7 +908,11 @@ namespace http {
|
||||||
i2p::win32::StopGracefulShutdown ();
|
i2p::win32::StopGracefulShutdown ();
|
||||||
#endif
|
#endif
|
||||||
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) {
|
} else if (cmd == HTTP_COMMAND_SHUTDOWN_NOW) {
|
||||||
|
#ifndef WIN32_APP
|
||||||
Daemon.running = false;
|
Daemon.running = false;
|
||||||
|
#else
|
||||||
|
i2p::win32::StopWin32App ();
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
res.code = 400;
|
res.code = 400;
|
||||||
ShowError(s, "Unknown command: " + cmd);
|
ShowError(s, "Unknown command: " + cmd);
|
||||||
|
|
Loading…
Add table
Reference in a new issue