diff options
| author | Martin Ridgers <[email protected]> | 2021-09-21 11:06:13 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-09-21 11:06:13 +0200 |
| commit | 68c951e0f440ffd483795dced737e88152c1a581 (patch) | |
| tree | 5c0910ca2a85b45fb05dba3ce457b7d156213894 /zenhttp/httpsys.cpp | |
| parent | Merge main into linux-mac (diff) | |
| parent | Trigger storage scrubbing pass at startup (diff) | |
| download | zen-68c951e0f440ffd483795dced737e88152c1a581.tar.xz zen-68c951e0f440ffd483795dced737e88152c1a581.zip | |
Merged main into linux-mac
Diffstat (limited to 'zenhttp/httpsys.cpp')
| -rw-r--r-- | zenhttp/httpsys.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index d70c88271..087d4c807 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -415,7 +415,7 @@ HttpMessageResponseRequest::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfB { ZEN_UNUSED(NumberOfBytesTransferred); - if (IoResult) + if (IoResult != NO_ERROR) { ZEN_WARN("response aborted due to error: '{}'", GetErrorAsString(IoResult)); @@ -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); + } } } @@ -897,9 +898,7 @@ HttpSysTransaction::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTran if (HttpSysRequestHandler* CurrentHandler = m_CompletionHandler) { - const bool IsInitialRequest = (CurrentHandler == &m_InitialHttpHandler) && m_InitialHttpHandler.IsInitialRequest(); - - if (IsInitialRequest) + if ((CurrentHandler == &m_InitialHttpHandler) && m_InitialHttpHandler.IsInitialRequest()) { // Ensure we have a sufficient number of pending requests outstanding m_HttpServer.OnHandlingRequest(); @@ -932,7 +931,7 @@ HttpSysTransaction::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTran } else { - if (IsInitialRequest == false) + if (CurrentHandler != &m_InitialHttpHandler) { delete CurrentHandler; } @@ -1253,11 +1252,12 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT switch (IoResult) { + default: case ERROR_OPERATION_ABORTED: return nullptr; - case ERROR_MORE_DATA: - // Insufficient buffer space + case ERROR_MORE_DATA: // Insufficient buffer space + case NO_ERROR: break; } |