aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpserver.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-04-27 14:35:38 +0200
committerGitHub <[email protected]>2023-04-27 14:35:38 +0200
commit88b977d78617c31f61f2a51e96b35ceeb7e9db72 (patch)
tree23a34aea9319a9f4dd41fbc39a51a783aeba7f0f /zenhttp/httpserver.cpp
parentbugfixes (#261) (diff)
downloadzen-88b977d78617c31f61f2a51e96b35ceeb7e9db72.tar.xz
zen-88b977d78617c31f61f2a51e96b35ceeb7e9db72.zip
made Ref<> constructor explicit (#262)
This change makes the Ref<> constructor explicit, which can help avoid unnecessary overheads and other accidents
Diffstat (limited to 'zenhttp/httpserver.cpp')
-rw-r--r--zenhttp/httpserver.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/zenhttp/httpserver.cpp b/zenhttp/httpserver.cpp
index 3576d9b3d..671cbd319 100644
--- a/zenhttp/httpserver.cpp
+++ b/zenhttp/httpserver.cpp
@@ -4,6 +4,7 @@
#include "httpasio.h"
#include "httpnull.h"
+#include "httpsys.h"
#include <zencore/compactbinary.h>
#include <zencore/compactbinarybuilder.h>
@@ -418,7 +419,7 @@ HttpService::HandlePackageRequest(HttpServerRequest& HttpServiceRequest)
{
ZEN_UNUSED(HttpServiceRequest);
- return nullptr;
+ return Ref<IHttpPackageHandler>();
}
//////////////////////////////////////////////////////////////////////////
@@ -738,17 +739,17 @@ CreateHttpServer(std::string_view ServerClass)
default:
case HttpServerClass::kHttpAsio:
ZEN_INFO("using asio HTTP server implementation");
- return new HttpAsioServer();
+ return Ref<HttpServer>(new HttpAsioServer());
#if ZEN_WITH_HTTPSYS
case HttpServerClass::kHttpSys:
ZEN_INFO("using http.sys server implementation");
- return CreateHttpSysServer(std::thread::hardware_concurrency(), /* background worker threads */ 16);
+ return Ref<HttpServer>(new HttpSysServer(std::thread::hardware_concurrency(), /* background worker threads */ 16));
#endif
case HttpServerClass::kHttpNull:
ZEN_INFO("using null HTTP server implementation");
- return new HttpNullServer;
+ return Ref<HttpServer>(new HttpNullServer);
}
}