aboutsummaryrefslogtreecommitdiff
path: root/zencore/httpsys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/httpsys.cpp')
-rw-r--r--zencore/httpsys.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/zencore/httpsys.cpp b/zencore/httpsys.cpp
index 7a17d6b9c..0fc0c0ef6 100644
--- a/zencore/httpsys.cpp
+++ b/zencore/httpsys.cpp
@@ -621,7 +621,7 @@ HttpMessageResponseRequest::IssueRequest()
//////////////////////////////////////////////////////////////////////////
-HttpSysServer::HttpSysServer(WinIoThreadPool& InThreadPool) : m_ThreadPool(InThreadPool)
+HttpSysServer::HttpSysServer(int ThreadCount) : m_ThreadPool(ThreadCount)
{
ULONG Result = HttpInitialize(HTTPAPI_VERSION_2, HTTP_INITIALIZE_SERVER, nullptr);
@@ -784,11 +784,6 @@ HttpSysServer::IssueNewRequestMaybe()
}
void
-HttpSysServer::StopServer()
-{
-}
-
-void
HttpSysServer::AddEndpoint(const char* UrlPath, HttpService& Service)
{
if (UrlPath[0] == '/')
@@ -1221,6 +1216,35 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT
return new HttpMessageResponseRequest(Transaction(), 500, ex.what());
}
}
+
+//////////////////////////////////////////////////////////////////////////
+//
+// HttpServer interface implementation
+//
+
+void
+HttpSysServer::Initialize(int BasePort)
+{
+ using namespace std::literals;
+
+ WideStringBuilder<64> BaseUri;
+ BaseUri << u8"http://*:"sv << int64_t(BasePort) << u8"/"sv;
+
+ Initialize(BaseUri.c_str());
+ StartServer();
+}
+
+void
+HttpSysServer::RequestExit()
+{
+ m_ShutdownEvent.Set();
+}
+void
+HttpSysServer::AddEndpoint(HttpService& Service)
+{
+ AddEndpoint(Service.BaseUri(), Service);
+}
+
#endif // ZEN_PLATFORM_WINDOWS
} // namespace zen