aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-11-01 14:04:35 +0100
committerGitHub Enterprise <[email protected]>2025-11-01 14:04:35 +0100
commita58da97f98697580bf128ed5723ba720cc30f0dc (patch)
tree798e392ddf76128a506293dc0803aaf852203dcd /src/zenserver/config
parentfix use-after-free in TEST_CASE("compactcas.threadedinsert") (#620) (diff)
downloadzen-a58da97f98697580bf128ed5723ba720cc30f0dc.tar.xz
zen-a58da97f98697580bf128ed5723ba720cc30f0dc.zip
Various fixes to address issues flagged by gcc / non-UE toolchain build (#621)
* gcc: avoid using memset on nontrivial struct * redundant `return std::move` * fixed various compilation issues flagged by gcc * fix issue in xmake.lua detecting whether we are building with the UE toolchain or not * add GCC ignore -Wundef (comment is inaccurate) * remove redundant std::move * don't catch exceptions by value * unreferenced variables * initialize "by the book" instead of memset * remove unused exception reference * add #include <cstring> to fix gcc build * explicitly poulate KeyValueMap by traversing input spans fixes gcc compilation * remove unreferenced variable * eliminate redundant `std::move` which gcc complains about * fix gcc compilation by including <cstring> * tag unreferenced variable to fix gcc compilation * fixes for various cases of naming members the same as their type
Diffstat (limited to 'src/zenserver/config')
-rw-r--r--src/zenserver/config/config.cpp40
-rw-r--r--src/zenserver/config/config.h4
-rw-r--r--src/zenserver/config/luaconfig.cpp1
3 files changed, 22 insertions, 23 deletions
diff --git a/src/zenserver/config/config.cpp b/src/zenserver/config/config.cpp
index e7cfd490a..18187711b 100644
--- a/src/zenserver/config/config.cpp
+++ b/src/zenserver/config/config.cpp
@@ -138,28 +138,28 @@ ZenServerConfiguratorBase::AddCommonConfigOptions(LuaConfig::Options& LuaOptions
LuaOptions.AddOption("server.noconsole"sv, ServerOptions.NoConsoleOutput, "noconsole"sv);
////// network
- LuaOptions.AddOption("network.httpserverclass"sv, ServerOptions.HttpServerConfig.ServerClass, "http"sv);
- LuaOptions.AddOption("network.httpserverthreads"sv, ServerOptions.HttpServerConfig.ThreadCount, "http-threads"sv);
+ LuaOptions.AddOption("network.httpserverclass"sv, ServerOptions.HttpConfig.ServerClass, "http"sv);
+ LuaOptions.AddOption("network.httpserverthreads"sv, ServerOptions.HttpConfig.ThreadCount, "http-threads"sv);
LuaOptions.AddOption("network.port"sv, ServerOptions.BasePort, "port"sv);
- LuaOptions.AddOption("network.forceloopback"sv, ServerOptions.HttpServerConfig.ForceLoopback, "http-forceloopback"sv);
+ LuaOptions.AddOption("network.forceloopback"sv, ServerOptions.HttpConfig.ForceLoopback, "http-forceloopback"sv);
#if ZEN_WITH_HTTPSYS
LuaOptions.AddOption("network.httpsys.async.workthreads"sv,
- ServerOptions.HttpServerConfig.HttpSys.AsyncWorkThreadCount,
+ ServerOptions.HttpConfig.HttpSys.AsyncWorkThreadCount,
"httpsys-async-work-threads"sv);
LuaOptions.AddOption("network.httpsys.async.response"sv,
- ServerOptions.HttpServerConfig.HttpSys.IsAsyncResponseEnabled,
+ ServerOptions.HttpConfig.HttpSys.IsAsyncResponseEnabled,
"httpsys-enable-async-response"sv);
LuaOptions.AddOption("network.httpsys.requestlogging"sv,
- ServerOptions.HttpServerConfig.HttpSys.IsRequestLoggingEnabled,
+ ServerOptions.HttpConfig.HttpSys.IsRequestLoggingEnabled,
"httpsys-enable-request-logging"sv);
#endif
#if ZEN_WITH_TRACE
////// trace
- LuaOptions.AddOption("trace.channels"sv, ServerOptions.TraceOptions.Channels, "trace"sv);
- LuaOptions.AddOption("trace.host"sv, ServerOptions.TraceOptions.Host, "tracehost"sv);
- LuaOptions.AddOption("trace.file"sv, ServerOptions.TraceOptions.File, "tracefile"sv);
+ LuaOptions.AddOption("trace.channels"sv, ServerOptions.TraceCmdLineOptions.Channels, "trace"sv);
+ LuaOptions.AddOption("trace.host"sv, ServerOptions.TraceCmdLineOptions.Host, "tracehost"sv);
+ LuaOptions.AddOption("trace.file"sv, ServerOptions.TraceCmdLineOptions.File, "tracefile"sv);
#endif
////// stats
@@ -291,7 +291,7 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
"",
"http-threads",
"Number of http server connection threads",
- cxxopts::value<unsigned int>(ServerOptions.HttpServerConfig.ThreadCount),
+ cxxopts::value<unsigned int>(ServerOptions.HttpConfig.ThreadCount),
"<http threads>");
options.add_option("network",
@@ -305,7 +305,7 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
"",
"http-forceloopback",
"Force using local loopback interface",
- cxxopts::value<bool>(ServerOptions.HttpServerConfig.ForceLoopback)->default_value("false"),
+ cxxopts::value<bool>(ServerOptions.HttpConfig.ForceLoopback)->default_value("false"),
"<http forceloopback>");
#if ZEN_WITH_HTTPSYS
@@ -313,21 +313,21 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
"",
"httpsys-async-work-threads",
"Number of HttpSys async worker threads",
- cxxopts::value<unsigned int>(ServerOptions.HttpServerConfig.HttpSys.AsyncWorkThreadCount),
+ cxxopts::value<unsigned int>(ServerOptions.HttpConfig.HttpSys.AsyncWorkThreadCount),
"<httpsys workthreads>");
options.add_option("httpsys",
"",
"httpsys-enable-async-response",
"Enables Httpsys async response",
- cxxopts::value<bool>(ServerOptions.HttpServerConfig.HttpSys.IsAsyncResponseEnabled)->default_value("true"),
+ cxxopts::value<bool>(ServerOptions.HttpConfig.HttpSys.IsAsyncResponseEnabled)->default_value("true"),
"<httpsys async response>");
options.add_option("httpsys",
"",
"httpsys-enable-request-logging",
"Enables Httpsys request logging",
- cxxopts::value<bool>(ServerOptions.HttpServerConfig.HttpSys.IsRequestLoggingEnabled),
+ cxxopts::value<bool>(ServerOptions.HttpConfig.HttpSys.IsRequestLoggingEnabled),
"<httpsys request logging>");
#endif
@@ -339,7 +339,7 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
"httpsys|"
#endif
"null)",
- cxxopts::value<std::string>(ServerOptions.HttpServerConfig.ServerClass)->default_value(DefaultHttp),
+ cxxopts::value<std::string>(ServerOptions.HttpConfig.ServerClass)->default_value(DefaultHttp),
"<http class>");
#if ZEN_WITH_TRACE
@@ -350,21 +350,21 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
"",
"trace",
"Specify which trace channels should be enabled",
- cxxopts::value<std::string>(ServerOptions.TraceOptions.Channels)->default_value(""),
+ cxxopts::value<std::string>(ServerOptions.TraceCmdLineOptions.Channels)->default_value(""),
"");
options.add_option("ue-trace",
"",
"tracehost",
"Hostname to send the trace to",
- cxxopts::value<std::string>(ServerOptions.TraceOptions.Host)->default_value(""),
+ cxxopts::value<std::string>(ServerOptions.TraceCmdLineOptions.Host)->default_value(""),
"");
options.add_option("ue-trace",
"",
"tracefile",
"Path to write a trace to",
- cxxopts::value<std::string>(ServerOptions.TraceOptions.File)->default_value(""),
+ cxxopts::value<std::string>(ServerOptions.TraceCmdLineOptions.File)->default_value(""),
"");
#endif // ZEN_WITH_TRACE
@@ -459,7 +459,7 @@ ZenServerConfiguratorBase::Configure(int argc, char* argv[])
if (!m_ServerOptions.HasTraceCommandlineOptions)
{
// Apply any Lua settings if we don't have them set from the command line
- TraceConfigure(m_ServerOptions.TraceOptions);
+ TraceConfigure(m_ServerOptions.TraceCmdLineOptions);
}
#endif
@@ -534,7 +534,7 @@ ZenServerConfiguratorBase::Configure(int argc, char* argv[])
m_ServerOptions.AbsLogFile = m_ServerOptions.DataDir / "logs" / "zenserver.log";
}
- m_ServerOptions.HttpServerConfig.IsDedicatedServer = m_ServerOptions.IsDedicated;
+ m_ServerOptions.HttpConfig.IsDedicatedServer = m_ServerOptions.IsDedicated;
}
void
diff --git a/src/zenserver/config/config.h b/src/zenserver/config/config.h
index 467f26ee7..40639da13 100644
--- a/src/zenserver/config/config.h
+++ b/src/zenserver/config/config.h
@@ -39,7 +39,7 @@ struct ZenSentryConfig
struct ZenServerConfig
{
- HttpServerConfig HttpServerConfig;
+ HttpServerConfig HttpConfig;
ZenSentryConfig SentryConfig;
ZenStatsConfig StatsConfig;
int BasePort = 8558; // Service listen port (used for both UDP and TCP)
@@ -66,7 +66,7 @@ struct ZenServerConfig
std::string Loggers[zen::logging::level::LogLevelCount];
#if ZEN_WITH_TRACE
bool HasTraceCommandlineOptions = false;
- TraceOptions TraceOptions;
+ TraceOptions TraceCmdLineOptions;
#endif
std::string MemoryOptions; // Memory allocation options
std::string CommandLine;
diff --git a/src/zenserver/config/luaconfig.cpp b/src/zenserver/config/luaconfig.cpp
index 2c54de29e..61969019c 100644
--- a/src/zenserver/config/luaconfig.cpp
+++ b/src/zenserver/config/luaconfig.cpp
@@ -330,7 +330,6 @@ Options::Print(zen::StringBuilderBase& SB, const cxxopts::ParseResult& CmdLineRe
};
std::vector<std::string> CurrentTablePath;
std::string Indent;
- auto It = SortedKeys.begin();
for (const std::string& Key : SortedKeys)
{
std::vector<std::string> KeyPath = GetTablePath(Key);