aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpnull.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-01-29 17:59:34 -0800
committerLiam Mitchell <[email protected]>2026-01-29 17:59:34 -0800
commitfa8e3171614e188766553db569e09f7bc0d377bc (patch)
tree430894631f4bfb970ca0c082744e2eb2caae6b92 /src/zenhttp/servers/httpnull.cpp
parentRun Windows service as an interactive session, so we correctly respond to Req... (diff)
downloadzen-fa8e3171614e188766553db569e09f7bc0d377bc.tar.xz
zen-fa8e3171614e188766553db569e09f7bc0d377bc.zip
Respond to RequestApplicationExit() in http server implementations even in non-interactive sessions
Diffstat (limited to 'src/zenhttp/servers/httpnull.cpp')
-rw-r--r--src/zenhttp/servers/httpnull.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/zenhttp/servers/httpnull.cpp b/src/zenhttp/servers/httpnull.cpp
index 06838a0ed..0ec1cb3c4 100644
--- a/src/zenhttp/servers/httpnull.cpp
+++ b/src/zenhttp/servers/httpnull.cpp
@@ -34,23 +34,17 @@ HttpNullServer::OnInitialize(int BasePort, std::filesystem::path DataDir)
void
HttpNullServer::OnRun(bool IsInteractiveSession)
{
- const bool TestMode = !IsInteractiveSession;
-
- int WaitTimeout = -1;
- if (!TestMode)
- {
- WaitTimeout = 1000;
- }
+ const int WaitTimeout = 1000;
#if ZEN_PLATFORM_WINDOWS
- if (TestMode == false)
+ if (IsInteractiveSession)
{
ZEN_CONSOLE("Zen Server running (null HTTP). Press ESC or Q to quit");
}
do
{
- if (!TestMode && _kbhit() != 0)
+ if (IsInteractiveSession && _kbhit() != 0)
{
char c = (char)_getch();
@@ -63,7 +57,7 @@ HttpNullServer::OnRun(bool IsInteractiveSession)
m_ShutdownEvent.Wait(WaitTimeout);
} while (!IsApplicationExitRequested());
#else
- if (TestMode == false)
+ if (IsInteractiveSession)
{
ZEN_CONSOLE("Zen Server running (null HTTP). Ctrl-C to quit");
}