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/httpplugin.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/httpplugin.cpp')
| -rw-r--r-- | src/zenhttp/servers/httpplugin.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/zenhttp/servers/httpplugin.cpp b/src/zenhttp/servers/httpplugin.cpp index d6ca7e1c5..426e62179 100644 --- a/src/zenhttp/servers/httpplugin.cpp +++ b/src/zenhttp/servers/httpplugin.cpp @@ -95,11 +95,11 @@ struct HttpPluginServerImpl : public HttpPluginServer, TransportServer // HttpPluginServer - virtual void RegisterService(HttpService& Service) override; - virtual int Initialize(int BasePort, std::filesystem::path DataDir) override; - virtual void Run(bool IsInteractiveSession) override; - virtual void RequestExit() override; - virtual void Close() override; + virtual void OnRegisterService(HttpService& Service) override; + virtual int OnInitialize(int BasePort, std::filesystem::path DataDir) override; + virtual void OnRun(bool IsInteractiveSession) override; + virtual void OnRequestExit() override; + virtual void OnClose() override; virtual void AddPlugin(Ref<TransportPlugin> Plugin) override; virtual void RemovePlugin(Ref<TransportPlugin> Plugin) override; @@ -706,7 +706,7 @@ HttpPluginServerImpl::CreateConnectionHandler(TransportConnection* Connection) } int -HttpPluginServerImpl::Initialize(int BasePort, std::filesystem::path DataDir) +HttpPluginServerImpl::OnInitialize(int BasePort, std::filesystem::path DataDir) { ZEN_TRACE_CPU("HttpPluginServerImpl::Initialize"); @@ -740,7 +740,7 @@ HttpPluginServerImpl::Initialize(int BasePort, std::filesystem::path DataDir) } void -HttpPluginServerImpl::Close() +HttpPluginServerImpl::OnClose() { if (!m_IsInitialized) return; @@ -776,7 +776,7 @@ HttpPluginServerImpl::Close() } void -HttpPluginServerImpl::Run(bool IsInteractive) +HttpPluginServerImpl::OnRun(bool IsInteractive) { ZEN_MEMSCOPE(GetHttppluginTag()); @@ -822,7 +822,7 @@ HttpPluginServerImpl::Run(bool IsInteractive) } void -HttpPluginServerImpl::RequestExit() +HttpPluginServerImpl::OnRequestExit() { m_ShutdownEvent.Set(); } @@ -850,7 +850,7 @@ HttpPluginServerImpl::RemovePlugin(Ref<TransportPlugin> Plugin) } void -HttpPluginServerImpl::RegisterService(HttpService& Service) +HttpPluginServerImpl::OnRegisterService(HttpService& Service) { ZEN_MEMSCOPE(GetHttppluginTag()); |