aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpsys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhttp/httpsys.cpp')
-rw-r--r--src/zenhttp/httpsys.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/zenhttp/httpsys.cpp b/src/zenhttp/httpsys.cpp
index 0b06f0558..2f8e0a898 100644
--- a/src/zenhttp/httpsys.cpp
+++ b/src/zenhttp/httpsys.cpp
@@ -721,11 +721,13 @@ HttpAsyncWorkRequest::AsyncWorkItem::Execute()
\/ \/ \/
*/
-HttpSysServer::HttpSysServer(unsigned int ThreadCount, unsigned int AsyncWorkThreadCount)
+HttpSysServer::HttpSysServer(const Config& Config)
: m_Log(logging::Get("http"))
, m_RequestLog(logging::Get("http_requests"))
-, m_ThreadPool(ThreadCount)
-, m_AsyncWorkPool(AsyncWorkThreadCount, "http_async")
+, m_IsRequestLoggingEnabled(Config.IsRequestLoggingEnabled)
+, m_IsAsyncResponseEnabled(Config.IsAsyncResponseEnabled)
+, m_ThreadPool(Config.ThreadCount != 0 ? Config.ThreadCount : std::thread::hardware_concurrency())
+, m_AsyncWorkPool(Config.AsyncWorkThreadCount != 0 ? Config.AsyncWorkThreadCount : 16, "http_async")
{
ULONG Result = HttpInitialize(HTTPAPI_VERSION_2, HTTP_INITIALIZE_SERVER, nullptr);
@@ -737,7 +739,7 @@ HttpSysServer::HttpSysServer(unsigned int ThreadCount, unsigned int AsyncWorkThr
m_IsHttpInitialized = true;
m_IsOk = true;
- ZEN_INFO("http.sys server started, using {} I/O threads and {} async worker threads", ThreadCount, AsyncWorkThreadCount);
+ ZEN_INFO("http.sys server started, using {} I/O threads and {} async worker threads", Config.ThreadCount, Config.AsyncWorkThreadCount);
}
HttpSysServer::~HttpSysServer()
@@ -1697,11 +1699,5 @@ HttpSysServer::RegisterService(HttpService& Service)
RegisterService(Service.BaseUri(), Service);
}
-Ref<HttpServer>
-CreateHttpSysServer(int Concurrency, int BackgroundWorkerThreads)
-{
- return Ref<HttpServer>(new HttpSysServer(Concurrency, BackgroundWorkerThreads));
-}
-
} // namespace zen
#endif