diff options
| author | Stefan Boberg <[email protected]> | 2021-09-09 13:58:37 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-09 13:58:37 +0200 |
| commit | 565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf (patch) | |
| tree | dfce4e0b8cbbafb416c9a7ce7e38a3d25fbdde48 /zenserver/zenserver.cpp | |
| parent | Moved http.sys server implementation into dedicated source files (diff) | |
| download | zen-565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf.tar.xz zen-565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf.zip | |
Made HttpServer an abstract interface, and moved remaining implementation specifics for http.sys into the dedicated cpp/h source files
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
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<zen::HttpServer> m_Http; std::unique_ptr<zen::CasStore> m_CasStore{zen::CreateCasStore()}; std::unique_ptr<zen::CidStore> m_CidStore; std::unique_ptr<ZenCacheStore> m_CacheStore; |