From 11f7f70b825c5b6784f5e2609463a1a9d1a0dabc Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 11 Oct 2023 14:59:25 +0200 Subject: 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 --- src/zenhttp/httpserver.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/zenhttp/httpserver.cpp') 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 @@ -770,6 +771,11 @@ CreateHttpServer(const HttpServerConfig& Config) Server->AddPlugin(WinsockPlugin); # endif +# if 0 + Ref AsioPlugin{CreateAsioTransportPlugin(1337, Config.ThreadCount)}; + Server->AddPlugin(AsioPlugin); +# endif + # if 0 Ref DllPlugin{new DllTransportPlugin(1337, Config.ThreadCount)}; DllPlugin->LoadDll("winsock"); @@ -783,10 +789,10 @@ CreateHttpServer(const HttpServerConfig& Config) #if ZEN_WITH_HTTPSYS case HttpServerClass::kHttpSys: ZEN_INFO("using http.sys server implementation"); - return Ref(new HttpSysServer({.ThreadCount = Config.ThreadCount, - .AsyncWorkThreadCount = Config.HttpSys.AsyncWorkThreadCount, - .IsAsyncResponseEnabled = Config.HttpSys.IsAsyncResponseEnabled, - .IsRequestLoggingEnabled = Config.HttpSys.IsRequestLoggingEnabled})); + return Ref(CreateHttpSysServer({.ThreadCount = Config.ThreadCount, + .AsyncWorkThreadCount = Config.HttpSys.AsyncWorkThreadCount, + .IsAsyncResponseEnabled = Config.HttpSys.IsAsyncResponseEnabled, + .IsRequestLoggingEnabled = Config.HttpSys.IsRequestLoggingEnabled})); #endif case HttpServerClass::kHttpNull: -- cgit v1.2.3