aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpnull.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-12-14 12:34:47 +0100
committerPer Larsson <[email protected]>2021-12-14 12:34:47 +0100
commitb6c6568e1618f10d2160d836b65e35586e3c740f (patch)
treef6a929cf918850bbba87d0ee67cd3482b2d50e24 /zenhttp/httpnull.cpp
parentFixed bug in z$ service returning partial cache records and enable small obje... (diff)
parentPartial revert b363c5b (diff)
downloadzen-b6c6568e1618f10d2160d836b65e35586e3c740f.tar.xz
zen-b6c6568e1618f10d2160d836b65e35586e3c740f.zip
Merged main.
Diffstat (limited to 'zenhttp/httpnull.cpp')
-rw-r--r--zenhttp/httpnull.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/zenhttp/httpnull.cpp b/zenhttp/httpnull.cpp
index e49051ac5..31b13a6ce 100644
--- a/zenhttp/httpnull.cpp
+++ b/zenhttp/httpnull.cpp
@@ -2,9 +2,12 @@
#include "httpnull.h"
-#include <conio.h>
#include <zencore/logging.h>
+#if ZEN_PLATFORM_WINDOWS
+# include <conio.h>
+#endif
+
namespace zen {
HttpNullServer::HttpNullServer()
@@ -32,6 +35,13 @@ HttpNullServer::Run(bool IsInteractiveSession)
{
const bool TestMode = !IsInteractiveSession;
+ int WaitTimeout = -1;
+ if (!TestMode)
+ {
+ WaitTimeout = 1000;
+ }
+
+#if ZEN_PLATFORM_WINDOWS
if (TestMode == false)
{
zen::logging::ConsoleLog().info("Zen Server running (null HTTP). Press ESC or Q to quit");
@@ -39,13 +49,6 @@ HttpNullServer::Run(bool IsInteractiveSession)
do
{
- int WaitTimeout = -1;
-
- if (!TestMode)
- {
- WaitTimeout = 1000;
- }
-
if (!TestMode && _kbhit() != 0)
{
char c = (char)_getch();
@@ -58,6 +61,17 @@ HttpNullServer::Run(bool IsInteractiveSession)
m_ShutdownEvent.Wait(WaitTimeout);
} while (!IsApplicationExitRequested());
+#else
+ if (TestMode == false)
+ {
+ zen::logging::ConsoleLog().info("Zen Server running (null HTTP). Ctrl-C to quit");
+ }
+
+ do
+ {
+ m_ShutdownEvent.Wait(WaitTimeout);
+ } while (!IsApplicationExitRequested());
+#endif
}
void