aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpasio.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-12-11 09:34:24 +0100
committerGitHub Enterprise <[email protected]>2025-12-11 09:34:24 +0100
commit3de9a65cd990f2a4f5395b7e2a094471633eb98b (patch)
treef1640a32fd2b68a8f1b6f77f5ba5c4cbf959cb0b /src/zenhttp/servers/httpasio.cpp
parent5.7.14-pre3 (diff)
downloadzen-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/httpasio.cpp')
-rw-r--r--src/zenhttp/servers/httpasio.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp
index 3970dea12..12aee1ee0 100644
--- a/src/zenhttp/servers/httpasio.cpp
+++ b/src/zenhttp/servers/httpasio.cpp
@@ -1298,11 +1298,11 @@ public:
HttpAsioServer(const AsioConfig& Config);
~HttpAsioServer();
- 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;
private:
Event m_ShutdownEvent;
@@ -1328,7 +1328,7 @@ HttpAsioServer::~HttpAsioServer()
}
void
-HttpAsioServer::Close()
+HttpAsioServer::OnClose()
{
try
{
@@ -1342,13 +1342,13 @@ HttpAsioServer::Close()
}
void
-HttpAsioServer::RegisterService(HttpService& Service)
+HttpAsioServer::OnRegisterService(HttpService& Service)
{
m_Impl->RegisterService(Service.BaseUri(), Service);
}
int
-HttpAsioServer::Initialize(int BasePort, std::filesystem::path DataDir)
+HttpAsioServer::OnInitialize(int BasePort, std::filesystem::path DataDir)
{
ZEN_TRACE_CPU("HttpAsioServer::Initialize");
m_Impl->Initialize(DataDir);
@@ -1372,7 +1372,7 @@ HttpAsioServer::Initialize(int BasePort, std::filesystem::path DataDir)
}
void
-HttpAsioServer::Run(bool IsInteractive)
+HttpAsioServer::OnRun(bool IsInteractive)
{
const bool TestMode = !IsInteractive;
@@ -1416,7 +1416,7 @@ HttpAsioServer::Run(bool IsInteractive)
}
void
-HttpAsioServer::RequestExit()
+HttpAsioServer::OnRequestExit()
{
m_ShutdownEvent.Set();
}