Force use of c-ares inet_net_pton and style adjustments

This commit is contained in:
Arthur Passos 2022-07-13 11:51:43 -03:00
parent 395dada988
commit 7f4043a3ed
4 changed files with 10 additions and 8 deletions

View File

@ -27,10 +27,9 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HAVE_LIBNSL OFF CACHE BOOL "" FORCE)
endif()
# Force use of c-ares inet_net_pton instead of libresolv one
set(HAVE_INET_NET_PTON OFF CACHE BOOL "" FORCE)
add_subdirectory("../c-ares/" "../c-ares/")
add_library(ch_contrib::c-ares ALIAS c-ares)
find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv REQUIRED)
target_link_libraries(c-ares PRIVATE ${LIBRESOLV_LIBRARY})
add_library(ch_contrib::c-ares ALIAS c-ares)

View File

@ -3,7 +3,8 @@
#include <string>
#include <vector>
namespace DB {
namespace DB
{
struct DNSPTRResolver
{

View File

@ -1,7 +1,8 @@
#include "DNSPTRResolverProvider.h"
#include "CaresPTRResolver.h"
namespace DB {
namespace DB
{
std::shared_ptr<DNSPTRResolver> DNSPTRResolverProvider::get()
{
static auto cares_resolver = std::make_shared<CaresPTRResolver>(

View File

@ -3,7 +3,8 @@
#include <memory>
#include "DNSPTRResolver.h"
namespace DB {
namespace DB
{
/*
* Provides a ready-to-use DNSPTRResolver instance.
* It hides 3rd party lib dependencies, handles initialization and lifetime.