diff options
Diffstat (limited to 'src/zenserver/proxy/zenproxyserver.cpp')
| -rw-r--r-- | src/zenserver/proxy/zenproxyserver.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/zenserver/proxy/zenproxyserver.cpp b/src/zenserver/proxy/zenproxyserver.cpp index cf84c159a..ffa9a4295 100644 --- a/src/zenserver/proxy/zenproxyserver.cpp +++ b/src/zenserver/proxy/zenproxyserver.cpp @@ -257,7 +257,7 @@ ZenProxyServerConfigurator::ValidateOptions() for (const std::string& Raw : m_RawProxyMappings) { // The mode keyword "proxy" from argv[1] gets captured as a positional - // argument — skip it. + // argument - skip it. if (Raw == "proxy") { continue; @@ -304,7 +304,7 @@ ZenProxyServer::Initialize(const ZenProxyServerConfig& ServerConfig, ZenServerSt // worker threads don't exit prematurely between async operations. m_ProxyIoWorkGuard.emplace(m_ProxyIoContext.get_executor()); - // Start proxy I/O worker threads. Use a modest thread count — proxy work is + // Start proxy I/O worker threads. Use a modest thread count - proxy work is // I/O-bound so we don't need a thread per core, but having more than one // avoids head-of-line blocking when many connections are active. unsigned int ThreadCount = std::max(GetHardwareConcurrency() / 4, 4u); @@ -324,7 +324,7 @@ ZenProxyServer::Initialize(const ZenProxyServerConfig& ServerConfig, ZenServerSt m_ApiService = std::make_unique<HttpApiService>(*m_Http); m_Http->RegisterService(*m_ApiService); - m_FrontendService = std::make_unique<HttpFrontendService>(m_ContentRoot, m_StatusService); + m_FrontendService = std::make_unique<HttpFrontendService>(m_ContentRoot, m_StatsService, m_StatusService); m_Http->RegisterService(*m_FrontendService); std::string DefaultRecordDir = (m_DataRoot / "recordings").string(); @@ -385,6 +385,8 @@ ZenProxyServer::Run() OnReady(); + StartSelfSession("zenproxy"); + m_Http->Run(IsInteractiveMode); SetNewState(kShuttingDown); @@ -422,15 +424,16 @@ ZenProxyServer::Cleanup() m_IoRunner.join(); } - m_ProxyStatsService.reset(); - m_FrontendService.reset(); - m_ApiService.reset(); - - ShutdownServices(); if (m_Http) { m_Http->Close(); } + + ShutdownServices(); + + m_ProxyStatsService.reset(); + m_FrontendService.reset(); + m_ApiService.reset(); } catch (const std::exception& Ex) { |