diff options
| author | Stefan Boberg <[email protected]> | 2025-12-11 09:34:24 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-12-11 09:34:24 +0100 |
| commit | 3de9a65cd990f2a4f5395b7e2a094471633eb98b (patch) | |
| tree | f1640a32fd2b68a8f1b6f77f5ba5c4cbf959cb0b /src/zenhttp/servers/httpsys.cpp | |
| parent | 5.7.14-pre3 (diff) | |
| download | zen-3de9a65cd990f2a4f5395b7e2a094471633eb98b.tar.xz zen-3de9a65cd990f2a4f5395b7e2a094471633eb98b.zip | |
HTTP server API changes for improved extensibility (#684)
* refactored `HttpServer` so all subclass member functions are proctected, to make it easier to extend base functionality
* added API service, can be used to enumerate registered endpoints (at `/api`). Currently only very basic information is provided
Diffstat (limited to 'src/zenhttp/servers/httpsys.cpp')
| -rw-r--r-- | src/zenhttp/servers/httpsys.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 9dbdd7167..7b02f95f1 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -54,11 +54,11 @@ public: // HttpServer interface implementation - virtual int Initialize(int BasePort, std::filesystem::path DataDir) override; - virtual void Run(bool TestMode) override; - virtual void RequestExit() override; - virtual void RegisterService(HttpService& Service) override; - virtual void Close() override; + virtual int OnInitialize(int BasePort, std::filesystem::path DataDir) override; + virtual void OnRun(bool TestMode) override; + virtual void OnRequestExit() override; + virtual void OnRegisterService(HttpService& Service) override; + virtual void OnClose() override; WorkerThreadPool& WorkPool(); @@ -984,7 +984,7 @@ HttpSysServer::~HttpSysServer() } void -HttpSysServer::Close() +HttpSysServer::OnClose() { if (m_IsHttpInitialized) { @@ -1292,7 +1292,7 @@ HttpSysServer::StartServer() } void -HttpSysServer::Run(bool IsInteractive) +HttpSysServer::OnRun(bool IsInteractive) { if (IsInteractive) { @@ -2097,7 +2097,7 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT // int -HttpSysServer::Initialize(int BasePort, std::filesystem::path DataDir) +HttpSysServer::OnInitialize(int BasePort, std::filesystem::path DataDir) { ZEN_TRACE_CPU("HttpSysServer::Initialize"); @@ -2115,13 +2115,13 @@ HttpSysServer::Initialize(int BasePort, std::filesystem::path DataDir) } void -HttpSysServer::RequestExit() +HttpSysServer::OnRequestExit() { m_ShutdownEvent.Set(); } void -HttpSysServer::RegisterService(HttpService& Service) +HttpSysServer::OnRegisterService(HttpService& Service) { RegisterService(Service.BaseUri(), Service); } |