From 6a1ad301c7b16b5c7361da68cf3e04d6efbfa5a9 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 13 Oct 2025 09:53:36 +0200 Subject: hide http.sys options when unavailable (#568) --- src/zenhttp/servers/httpsys.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index c83675f2c..0be53ffee 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -1013,7 +1013,7 @@ HttpSysServer::InitializeServer(int BasePort) { ZEN_ERROR("Failed to create server session for '{}': {:#x}", WideToUtf8(WildcardUrlPath), Result); - return BasePort; + return 0; } Result = HttpCreateUrlGroup(m_HttpSessionId, &m_HttpUrlGroupId, 0); @@ -1022,7 +1022,7 @@ HttpSysServer::InitializeServer(int BasePort) { ZEN_ERROR("Failed to create URL group for '{}': {:#x}", WideToUtf8(WildcardUrlPath), Result); - return BasePort; + return 0; } m_BaseUris.clear(); @@ -1137,7 +1137,7 @@ HttpSysServer::InitializeServer(int BasePort) { ZEN_ERROR("Failed to create request queue for '{}': {:#x}", WideToUtf8(m_BaseUris.front()), Result); - return EffectivePort; + return 0; } HttpBindingInfo.Flags.Present = 1; @@ -1149,7 +1149,7 @@ HttpSysServer::InitializeServer(int BasePort) { ZEN_ERROR("Failed to set server binding property for '{}': {:#x}", WideToUtf8(m_BaseUris.front()), Result); - return EffectivePort; + return 0; } // Configure rejection method. Default is to drop the connection, it's better if we @@ -1191,6 +1191,8 @@ HttpSysServer::InitializeServer(int BasePort) if (ErrorCode) { ZEN_ERROR("Failed to create IOCP for '{}': {}", WideToUtf8(m_BaseUris.front()), ErrorCode.message()); + + return 0; } else { -- cgit v1.2.3