aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpsys.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-17 23:18:20 +0200
committerStefan Boberg <[email protected]>2021-09-17 23:18:48 +0200
commit0ee89539ead8631b02953ddf601770aefa557edb (patch)
treeef2e09d747bb3d7497507362bda560b905d478d6 /zenhttp/httpsys.cpp
parentAdded IsInteractiveSession() query to help identify if the process is running... (diff)
downloadzen-0ee89539ead8631b02953ddf601770aefa557edb.tar.xz
zen-0ee89539ead8631b02953ddf601770aefa557edb.zip
zenserver can now run as a Windows service. We'll still need to improve how data files are found as the current defaults are relative to the user directory which ends up being in the Windows folder when running as the local system user
Diffstat (limited to 'zenhttp/httpsys.cpp')
-rw-r--r--zenhttp/httpsys.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp
index c2d4ef14c..b5313021c 100644
--- a/zenhttp/httpsys.cpp
+++ b/zenhttp/httpsys.cpp
@@ -707,29 +707,30 @@ HttpSysServer::StartServer()
}
void
-HttpSysServer::Run(bool TestMode)
+HttpSysServer::Run(bool IsInteractive)
{
- if (TestMode == false)
+ if (IsInteractive)
{
zen::logging::ConsoleLog().info("Zen Server running. Press ESC or Q to quit");
}
do
{
- int WaitTimeout = -1;
+ //int WaitTimeout = -1;
+ int WaitTimeout = 100;
- if (!TestMode)
+ if (IsInteractive)
{
WaitTimeout = 1000;
- }
-
- if (!TestMode && _kbhit() != 0)
- {
- char c = (char)_getch();
- if (c == 27 || c == 'Q' || c == 'q')
+ if (_kbhit() != 0)
{
- RequestApplicationExit(0);
+ char c = (char)_getch();
+
+ if (c == 27 || c == 'Q' || c == 'q')
+ {
+ RequestApplicationExit(0);
+ }
}
}