mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
24ac18201c
Update isLocalAddress.cpp Update IBlockOutputStream.h Update users.xml
26 lines
427 B
C++
26 lines
427 B
C++
#include <Poco/Net/DNS.h>
|
|
#include <Common/getFQDNOrHostName.h>
|
|
|
|
|
|
namespace
|
|
{
|
|
std::string getFQDNOrHostNameImpl()
|
|
{
|
|
try
|
|
{
|
|
return Poco::Net::DNS::thisHost().name();
|
|
}
|
|
catch (...)
|
|
{
|
|
return Poco::Net::DNS::hostName();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
const std::string & getFQDNOrHostName()
|
|
{
|
|
static std::string result = getFQDNOrHostNameImpl();
|
|
return result;
|
|
}
|