Link cpp-dns/udns unconditionally and update submodules to clickhouse fork

This commit is contained in:
Arthur Passos 2022-07-04 09:08:45 -03:00
parent dcda1c5eb9
commit 5c00dcd884
5 changed files with 18 additions and 24 deletions

4
.gitmodules vendored
View File

@ -276,7 +276,7 @@
url = https://github.com/ClickHouse/base-x.git
[submodule "contrib/udns"]
path = contrib/udns
url = https://github.com/arthurpassos/udns.git
url = https://github.com/ClickHouse/udns
[submodule "contrib/cpp-dns"]
path = contrib/cpp-dns
url = https://github.com/YukiWorkshop/cpp-dns.git
url = https://github.com/ClickHouse/cpp-dns

View File

@ -2,9 +2,9 @@ set(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/cpp-dns")
set(SRCS "${LIBRARY_DIR}/DNSResolver.cpp")
set(HDRS "${LIBRARY_DIR}/DNSResolver.hpp")
#set(HDRS "${LIBRARY_DIR}/DNSResolver.hpp")
add_library(_cpp-dns ${SRCS} ${HDRS})
add_library(_cpp-dns ${SRCS})
target_link_libraries(_cpp-dns boost::system boost::headers_only ch_contrib::udns)

View File

@ -1,22 +1,22 @@
set(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/udns")
add_library(_udns
"${LIBRARY_DIR}/udns_dn.c"
"${LIBRARY_DIR}/udns_bl.c"
"${LIBRARY_DIR}/udns_codes.c"
"${LIBRARY_DIR}/udns_dntosp.c"
"${LIBRARY_DIR}/udns_init.c"
"${LIBRARY_DIR}/udns_jran.c"
"${LIBRARY_DIR}/udns_misc.c"
"${LIBRARY_DIR}/udns_parse.c"
"${LIBRARY_DIR}/udns_resolver.c"
"${LIBRARY_DIR}/udns_init.c"
"${LIBRARY_DIR}/udns_misc.c"
"${LIBRARY_DIR}/udns_XtoX.c"
"${LIBRARY_DIR}/udns_rr_a.c"
"${LIBRARY_DIR}/udns_rr_ptr.c"
"${LIBRARY_DIR}/udns_rr_mx.c"
"${LIBRARY_DIR}/udns_rr_txt.c"
"${LIBRARY_DIR}/udns_bl.c"
"${LIBRARY_DIR}/udns_rr_srv.c"
"${LIBRARY_DIR}/udns_rr_naptr.c"
"${LIBRARY_DIR}/udns_codes.c"
"${LIBRARY_DIR}/udns_jran.c"
"${LIBRARY_DIR}/udns_rr_ptr.c"
"${LIBRARY_DIR}/udns_rr_srv.c"
"${LIBRARY_DIR}/udns_rr_txt.c"
"${LIBRARY_DIR}/udns_XtoX.c"
"${LIBRARY_DIR}/udns_dn.c"
)
target_compile_definitions(_udns PRIVATE -DHAVE_CONFIG_H)

View File

@ -439,14 +439,8 @@ if (TARGET ch_contrib::avrocpp)
dbms_target_link_libraries(PRIVATE ch_contrib::avrocpp)
endif ()
if (TARGET ch_contrib::udns)
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::udns)
endif ()
if (TARGET ch_contrib::cpp-dns)
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::cpp-dns)
endif ()
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::udns)
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::cpp-dns)
if (TARGET OpenSSL::Crypto)
dbms_target_link_libraries (PRIVATE OpenSSL::Crypto)

View File

@ -147,12 +147,12 @@ static std::vector<String> reverseResolveImpl(const Poco::Net::IPAddress & addre
std::vector<std::string> ptr_records;
resolver.resolve_a4ptr(boost::asio::ip::address_v4::from_string(address.toString()), [&](int err, auto& hosts, auto&, auto&, uint) {
resolver.resolve_a4ptr(boost::asio::ip::address_v4::from_string(address.toString()), [&](int err, auto & hosts, auto &, auto &, uint) {
if (err) {
throw Exception("Cannot resolve: " + address.toString() + YukiWorkshop::DNSResolver::error_string(err), ErrorCodes::DNS_ERROR);
}
for (auto &it : hosts) {
for (auto & it : hosts) {
ptr_records.emplace_back(it);
}