Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#7281
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
ywqzzy authored and ti-chi-bot committed Jul 12, 2024
1 parent d8cb780 commit 7ded564
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dbms/src/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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)
{
Expand All @@ -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();
}
Expand Down

0 comments on commit 7ded564

Please sign in to comment.