From 565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Thu, 9 Sep 2021 13:58:37 +0200 Subject: Made HttpServer an abstract interface, and moved remaining implementation specifics for http.sys into the dedicated cpp/h source files --- zenserver/zenserver.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'zenserver/zenserver.cpp') diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index 57e691ea1..db14e2c05 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -227,37 +227,38 @@ public: spdlog::info("NOT starting mesh"); } - m_Http.Initialize(BasePort); - m_Http.AddEndpoint(m_HealthService); + m_Http = zen::CreateHttpServer(); + m_Http->Initialize(BasePort); + m_Http->AddEndpoint(m_HealthService); if (m_TestMode) { - m_Http.AddEndpoint(m_TestService); - m_Http.AddEndpoint(m_TestingService); + m_Http->AddEndpoint(m_TestService); + m_Http->AddEndpoint(m_TestingService); } - m_Http.AddEndpoint(m_AdminService); + m_Http->AddEndpoint(m_AdminService); if (m_HttpProjectService) { - m_Http.AddEndpoint(*m_HttpProjectService); + m_Http->AddEndpoint(*m_HttpProjectService); } - m_Http.AddEndpoint(m_CasService); + m_Http->AddEndpoint(m_CasService); if (m_StructuredCacheService) { - m_Http.AddEndpoint(*m_StructuredCacheService); + m_Http->AddEndpoint(*m_StructuredCacheService); } if (m_HttpLaunchService) { - m_Http.AddEndpoint(*m_HttpLaunchService); + m_Http->AddEndpoint(*m_HttpLaunchService); } if (m_HttpFunctionService) { - m_Http.AddEndpoint(*m_HttpFunctionService); + m_Http->AddEndpoint(*m_HttpFunctionService); } } @@ -295,7 +296,7 @@ public: __debugbreak(); } - m_Http.Run(m_TestMode); + m_Http->Run(m_TestMode); spdlog::info(ZEN_APP_NAME " exiting"); @@ -307,7 +308,7 @@ public: void RequestExit(int ExitCode) { RequestApplicationExit(ExitCode); - m_Http.RequestExit(); + m_Http->RequestExit(); } void Cleanup() { spdlog::info(ZEN_APP_NAME " cleaning up"); } @@ -369,7 +370,7 @@ private: zen::ProcessHandle m_Process; zen::NamedMutex m_ServerMutex; - zen::HttpServer m_Http; + zen::Ref m_Http; std::unique_ptr m_CasStore{zen::CreateCasStore()}; std::unique_ptr m_CidStore; std::unique_ptr m_CacheStore; -- cgit v1.2.3