diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenhttp/servers/httpsys.cpp | 10 | ||||
| -rw-r--r-- | src/zenserver/config.cpp | 11 | ||||
| -rw-r--r-- | src/zenserver/zenserver.cpp | 2 |
3 files changed, 16 insertions, 7 deletions
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 { diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index 697d44214..a355f0ed5 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -506,6 +506,7 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("network.port"sv, ServerOptions.BasePort, "port"sv); LuaOptions.AddOption("network.forceloopback"sv, ServerOptions.HttpServerConfig.ForceLoopback, "http-forceloopback"sv); +#if ZEN_WITH_HTTPSYS LuaOptions.AddOption("network.httpsys.async.workthreads"sv, ServerOptions.HttpServerConfig.HttpSys.AsyncWorkThreadCount, "httpsys-async-work-threads"sv); @@ -515,6 +516,7 @@ ParseConfigFile(const std::filesystem::path& Path, LuaOptions.AddOption("network.httpsys.requestlogging"sv, ServerOptions.HttpServerConfig.HttpSys.IsRequestLoggingEnabled, "httpsys-enable-request-logging"sv); +#endif #if ZEN_WITH_TRACE ////// trace @@ -817,7 +819,6 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) options.add_options()("malloc", "Configure memory allocator subsystem", cxxopts::value(ServerOptions.MemoryOptions)->default_value("mimalloc")); - options.add_options()("corelimit", "Limit concurrency", cxxopts::value(ServerOptions.CoreLimit)); // clang-format off options.add_options("logging") @@ -890,7 +891,11 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) options.add_option("network", "", "http", - "Select HTTP server implementation (asio|httpsys|null)", + "Select HTTP server implementation (asio|" +#if ZEN_WITH_HTTPSYS + "httpsys|" +#endif + "null)", cxxopts::value<std::string>(ServerOptions.HttpServerConfig.ServerClass)->default_value(DefaultHttp), "<http class>"); @@ -915,6 +920,7 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) cxxopts::value<bool>(ServerOptions.HttpServerConfig.ForceLoopback)->default_value("false"), "<http forceloopback>"); +#if ZEN_WITH_HTTPSYS options.add_option("httpsys", "", "httpsys-async-work-threads", @@ -935,6 +941,7 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) "Enables Httpsys request logging", cxxopts::value<bool>(ServerOptions.HttpServerConfig.HttpSys.IsRequestLoggingEnabled), "<httpsys request logging>"); +#endif #if ZEN_WITH_TRACE // We only have this in options for command line help purposes - we parse these argument separately earlier using diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp index 975459e68..82ebc1711 100644 --- a/src/zenserver/zenserver.cpp +++ b/src/zenserver/zenserver.cpp @@ -190,7 +190,7 @@ ZenServer::Initialize(const ZenServerOptions& ServerOptions, ZenServerState::Zen int EffectiveBasePort = m_Http->Initialize(ServerOptions.BasePort, ServerOptions.DataDir); if (EffectiveBasePort == 0) { - ZEN_WARN("Failed to initialize http service '{}' using base port {} and data dir {}", + ZEN_WARN("Failed to initialize http service '{}' using base port {} and data dir '{}'", ServerOptions.HttpServerConfig.ServerClass, ServerOptions.BasePort, ServerOptions.DataDir); |