diff options
Diffstat (limited to 'src/zenhttp')
| -rw-r--r-- | src/zenhttp/httpserver.cpp | 3 | ||||
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpserver.h | 1 | ||||
| -rw-r--r-- | src/zenhttp/servers/httpasio.cpp | 4 | ||||
| -rw-r--r-- | src/zenhttp/servers/httpasio.h | 1 | ||||
| -rw-r--r-- | src/zenhttp/servers/httpsys.cpp | 2 | ||||
| -rw-r--r-- | src/zenhttp/servers/httpsys.h | 1 |
6 files changed, 8 insertions, 4 deletions
diff --git a/src/zenhttp/httpserver.cpp b/src/zenhttp/httpserver.cpp index 4d98e9650..e5cfbcbae 100644 --- a/src/zenhttp/httpserver.cpp +++ b/src/zenhttp/httpserver.cpp @@ -1033,7 +1033,7 @@ CreateHttpServerClass(const std::string_view ServerClass, const HttpServerConfig ZEN_INFO("using asio HTTP server implementation") return CreateHttpAsioServer(AsioConfig { .ThreadCount = Config.ThreadCount, .ForceLoopback = Config.ForceLoopback, .IsDedicatedServer = Config.IsDedicatedServer, - .NoNetwork = Config.NoNetwork, .UnixSocketPath = PathToUtf8(Config.UnixSocketPath), + .NoNetwork = Config.NoNetwork, .AllowPortProbing = Config.AllowPortProbing, .UnixSocketPath = PathToUtf8(Config.UnixSocketPath), #if ZEN_USE_OPENSSL .HttpsPort = Config.HttpsPort, .CertFile = Config.CertFile, .KeyFile = Config.KeyFile, #endif @@ -1049,6 +1049,7 @@ CreateHttpServerClass(const std::string_view ServerClass, const HttpServerConfig .IsRequestLoggingEnabled = Config.HttpSys.IsRequestLoggingEnabled, .IsDedicatedServer = Config.IsDedicatedServer, .ForceLoopback = Config.ForceLoopback, + .AllowPortProbing = Config.AllowPortProbing, .HttpsPort = Config.HttpSys.HttpsPort, .CertThumbprint = Config.HttpSys.CertThumbprint, .CertStoreName = Config.HttpSys.CertStoreName, diff --git a/src/zenhttp/include/zenhttp/httpserver.h b/src/zenhttp/include/zenhttp/httpserver.h index 2a8b2ca94..a7d7f4d9c 100644 --- a/src/zenhttp/include/zenhttp/httpserver.h +++ b/src/zenhttp/include/zenhttp/httpserver.h @@ -325,6 +325,7 @@ struct HttpServerPluginConfig struct HttpServerConfig { bool IsDedicatedServer = false; // Should be set to true for shared servers + bool AllowPortProbing = true; // IsDedicatedServer forces this to false std::string ServerClass; // Choice of HTTP server implementation std::vector<HttpServerPluginConfig> PluginConfigs; bool ForceLoopback = false; diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp index 9f4875eaf..a2cae8762 100644 --- a/src/zenhttp/servers/httpasio.cpp +++ b/src/zenhttp/servers/httpasio.cpp @@ -2182,7 +2182,7 @@ HttpAsioServerImpl::Start(uint16_t Port, const AsioConfig& Config) if (!Config.NoNetwork) { m_Acceptor.reset( - new asio_http::HttpAcceptor(*this, m_IoService, Port, Config.ForceLoopback, /*AllowPortProbing */ !Config.IsDedicatedServer)); + new asio_http::HttpAcceptor(*this, m_IoService, Port, Config.ForceLoopback, /*AllowPortProbing */ Config.AllowPortProbing)); if (!m_Acceptor->IsValid()) { @@ -2224,7 +2224,7 @@ HttpAsioServerImpl::Start(uint16_t Port, const AsioConfig& Config) *m_SslContext, gsl::narrow<uint16_t>(Config.HttpsPort), Config.ForceLoopback, - /*AllowPortProbing*/ !Config.IsDedicatedServer)); + /*AllowPortProbing*/ Config.AllowPortProbing)); if (m_HttpsAcceptor->IsValid()) { diff --git a/src/zenhttp/servers/httpasio.h b/src/zenhttp/servers/httpasio.h index 21d10170e..154c87d9c 100644 --- a/src/zenhttp/servers/httpasio.h +++ b/src/zenhttp/servers/httpasio.h @@ -12,6 +12,7 @@ struct AsioConfig bool ForceLoopback = false; bool IsDedicatedServer = false; bool NoNetwork = false; + bool AllowPortProbing = true; std::string UnixSocketPath; #if ZEN_USE_OPENSSL int HttpsPort = 0; // 0 = auto-assign; set CertFile/KeyFile to enable HTTPS diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index f8fb1c9be..9fe9a2254 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -1153,7 +1153,7 @@ HttpSysServer::RegisterHttpUrls(int BasePort) m_BaseUris.clear(); - const bool AllowPortProbing = !m_InitialConfig.IsDedicatedServer; + const bool AllowPortProbing = m_InitialConfig.AllowPortProbing; const bool AllowLocalOnly = !m_InitialConfig.IsDedicatedServer; int EffectivePort = BasePort; diff --git a/src/zenhttp/servers/httpsys.h b/src/zenhttp/servers/httpsys.h index ca465ad00..88ec13834 100644 --- a/src/zenhttp/servers/httpsys.h +++ b/src/zenhttp/servers/httpsys.h @@ -22,6 +22,7 @@ struct HttpSysConfig bool IsRequestLoggingEnabled = false; bool IsDedicatedServer = false; bool ForceLoopback = false; + bool AllowPortProbing = true; int HttpsPort = 0; // 0 = HTTPS disabled std::string CertThumbprint; // Hex SHA-1 (40 chars) for auto SSL binding std::string CertStoreName = "MY"; // Windows certificate store name |