From 7ded564f3881c23770de38cd95eb5719a10967bd Mon Sep 17 00:00:00 2001 From: EasonBall <592838129@qq.com> Date: Wed, 12 Apr 2023 20:37:01 +0800 Subject: [PATCH] This is an automated cherry-pick of #7281 Signed-off-by: ti-chi-bot --- dbms/src/Server/Server.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index 04e5ee5e814..c1a613d5770 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -704,8 +704,13 @@ class Server::TcpHttpServersHolder LOG_INFO(log, "tcp_port is closed because tls config is set"); } +<<<<<<< HEAD /// TCP with SSL if (config.has("tcp_port_secure") && !security_config.has_tls_config) +======= + /// TCP with SSL (Not supported yet) + if (config.has("tcp_port_secure") && !security_config->hasTlsConfig()) +>>>>>>> d993276831 (*: fix exception when no tcp and http server created (#7281)) { #if Poco_NetSSL_FOUND Poco::Net::Context::Ptr context = new Poco::Net::Context(Poco::Net::Context::TLSV1_2_SERVER_USE, @@ -732,6 +737,7 @@ class Server::TcpHttpServersHolder LOG_INFO(log, "tcp_port is closed because tls config is set"); } +<<<<<<< HEAD /// At least one of TCP and HTTP servers must be created. if (servers.empty()) throw Exception("No 'tcp_port' and 'http_port' is specified in configuration file.", ErrorCodes::NO_ELEMENTS_IN_CONFIG); @@ -755,6 +761,10 @@ class Server::TcpHttpServersHolder { LOG_INFO(log, "internal http port is closed because tls config is set"); } +======= + if (servers.empty()) + LOG_WARNING(log, "No TCP and HTTP servers are created"); +>>>>>>> d993276831 (*: fix exception when no tcp and http server created (#7281)) } catch (const Poco::Net::NetException & e) { @@ -770,10 +780,6 @@ class Server::TcpHttpServersHolder } } - if (servers.empty()) - throw Exception("No servers started (add valid listen_host and 'tcp_port' or 'http_port' to configuration file.)", - ErrorCodes::NO_ELEMENTS_IN_CONFIG); - for (auto & server : servers) server->start(); }