diff options
| author | Liam Mitchell <[email protected]> | 2026-01-29 17:59:34 -0800 |
|---|---|---|
| committer | Liam Mitchell <[email protected]> | 2026-01-29 17:59:34 -0800 |
| commit | fa8e3171614e188766553db569e09f7bc0d377bc (patch) | |
| tree | 430894631f4bfb970ca0c082744e2eb2caae6b92 /src/zenhttp/servers/httpasio.cpp | |
| parent | Run Windows service as an interactive session, so we correctly respond to Req... (diff) | |
| download | zen-fa8e3171614e188766553db569e09f7bc0d377bc.tar.xz zen-fa8e3171614e188766553db569e09f7bc0d377bc.zip | |
Respond to RequestApplicationExit() in http server implementations even in non-interactive sessions
Diffstat (limited to 'src/zenhttp/servers/httpasio.cpp')
| -rw-r--r-- | src/zenhttp/servers/httpasio.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp index be4e73576..6c25636a2 100644 --- a/src/zenhttp/servers/httpasio.cpp +++ b/src/zenhttp/servers/httpasio.cpp @@ -1909,23 +1909,17 @@ HttpAsioServer::OnInitialize(int BasePort, std::filesystem::path DataDir) void HttpAsioServer::OnRun(bool IsInteractive) { - const bool TestMode = !IsInteractive; - - int WaitTimeout = -1; - if (!TestMode) - { - WaitTimeout = 1000; - } + const int WaitTimeout = 1000; #if ZEN_PLATFORM_WINDOWS - if (TestMode == false) + if (IsInteractive) { ZEN_CONSOLE("Zen Server running (asio HTTP). Press ESC or Q to quit"); } do { - if (!TestMode && _kbhit() != 0) + if (IsInteractive && _kbhit() != 0) { char c = (char)_getch(); @@ -1938,7 +1932,7 @@ HttpAsioServer::OnRun(bool IsInteractive) m_ShutdownEvent.Wait(WaitTimeout); } while (!IsApplicationExitRequested()); #else - if (TestMode == false) + if (IsInteractive) { ZEN_CONSOLE("Zen Server running (asio HTTP). Ctrl-C to quit"); } |