aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpserver.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-11 14:59:25 +0200
committerGitHub <[email protected]>2023-10-11 14:59:25 +0200
commit11f7f70b825c5b6784f5e2609463a1a9d1a0dabc (patch)
tree98f65537f52327c354193afa98a29f9f838b42ff /src/zenhttp/httpserver.cpp
parenthide HttpAsioServer interface behind factory function (#463) (diff)
downloadzen-11f7f70b825c5b6784f5e2609463a1a9d1a0dabc.tar.xz
zen-11f7f70b825c5b6784f5e2609463a1a9d1a0dabc.zip
pluggable asio transport (#460)
added pluggable transport based on asio. This is in an experimental state and is not yet a replacement for httpasio even though that is the ultimate goal also moved plugin API header into dedicated part of the tree to clarify that it is meant to be usable in isolation, without any dependency on zencore et al moved transport implementations into dedicated source directory in zenhttp note that this adds code to the build but nothing should change at runtime since the instantiation of the new code is conditional and is inactive by default
Diffstat (limited to 'src/zenhttp/httpserver.cpp')
-rw-r--r--src/zenhttp/httpserver.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/zenhttp/httpserver.cpp b/src/zenhttp/httpserver.cpp
index f22438a58..a2ea4cff8 100644
--- a/src/zenhttp/httpserver.cpp
+++ b/src/zenhttp/httpserver.cpp
@@ -9,8 +9,9 @@
#include "zenhttp/httpplugin.h"
#if ZEN_WITH_PLUGINS
-# include "dlltransport.h"
-# include "winsocktransport.h"
+# include "transports/asiotransport.h"
+# include "transports/dlltransport.h"
+# include "transports/winsocktransport.h"
#endif
#include <zencore/compactbinary.h>
@@ -771,6 +772,11 @@ CreateHttpServer(const HttpServerConfig& Config)
# endif
# if 0
+ Ref<TransportPlugin> AsioPlugin{CreateAsioTransportPlugin(1337, Config.ThreadCount)};
+ Server->AddPlugin(AsioPlugin);
+# endif
+
+# if 0
Ref<DllTransportPlugin> DllPlugin{new DllTransportPlugin(1337, Config.ThreadCount)};
DllPlugin->LoadDll("winsock");
Server->AddPlugin(DllPlugin);
@@ -783,10 +789,10 @@ CreateHttpServer(const HttpServerConfig& Config)
#if ZEN_WITH_HTTPSYS
case HttpServerClass::kHttpSys:
ZEN_INFO("using http.sys server implementation");
- return Ref<HttpServer>(new HttpSysServer({.ThreadCount = Config.ThreadCount,
- .AsyncWorkThreadCount = Config.HttpSys.AsyncWorkThreadCount,
- .IsAsyncResponseEnabled = Config.HttpSys.IsAsyncResponseEnabled,
- .IsRequestLoggingEnabled = Config.HttpSys.IsRequestLoggingEnabled}));
+ return Ref<HttpServer>(CreateHttpSysServer({.ThreadCount = Config.ThreadCount,
+ .AsyncWorkThreadCount = Config.HttpSys.AsyncWorkThreadCount,
+ .IsAsyncResponseEnabled = Config.HttpSys.IsAsyncResponseEnabled,
+ .IsRequestLoggingEnabled = Config.HttpSys.IsRequestLoggingEnabled}));
#endif
case HttpServerClass::kHttpNull: