|
|
@ -555,10 +555,11 @@ PosixEventEngine::GetDNSResolver( |
|
|
|
const EventEngine::DNSResolver::ResolverOptions& options) { |
|
|
|
const EventEngine::DNSResolver::ResolverOptions& options) { |
|
|
|
#ifndef GRPC_POSIX_SOCKET_RESOLVE_ADDRESS |
|
|
|
#ifndef GRPC_POSIX_SOCKET_RESOLVE_ADDRESS |
|
|
|
grpc_core::Crash("Unable to get DNS resolver for this platform."); |
|
|
|
grpc_core::Crash("Unable to get DNS resolver for this platform."); |
|
|
|
#else // GRPC_POSIX_SOCKET_RESOLVE_ADDRESS
|
|
|
|
#else // GRPC_POSIX_SOCKET_RESOLVE_ADDRESS
|
|
|
|
// If c-ares is supported on the platform, build according to user's
|
|
|
|
// If c-ares is supported on the platform, build according to user's
|
|
|
|
// configuration.
|
|
|
|
// configuration.
|
|
|
|
if (ShouldUseAresDnsResolver()) { |
|
|
|
if (ShouldUseAresDnsResolver()) { |
|
|
|
|
|
|
|
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) |
|
|
|
GRPC_EVENT_ENGINE_DNS_TRACE("PosixEventEngine:%p creating AresResolver", |
|
|
|
GRPC_EVENT_ENGINE_DNS_TRACE("PosixEventEngine:%p creating AresResolver", |
|
|
|
this); |
|
|
|
this); |
|
|
|
auto ares_resolver = AresResolver::CreateAresResolver( |
|
|
|
auto ares_resolver = AresResolver::CreateAresResolver( |
|
|
@ -570,6 +571,7 @@ PosixEventEngine::GetDNSResolver( |
|
|
|
} |
|
|
|
} |
|
|
|
return std::make_unique<PosixEventEngine::PosixDNSResolver>( |
|
|
|
return std::make_unique<PosixEventEngine::PosixDNSResolver>( |
|
|
|
std::move(*ares_resolver)); |
|
|
|
std::move(*ares_resolver)); |
|
|
|
|
|
|
|
#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
|
|
|
|
} |
|
|
|
} |
|
|
|
GRPC_EVENT_ENGINE_DNS_TRACE("PosixEventEngine:%p creating NativeDNSResolver", |
|
|
|
GRPC_EVENT_ENGINE_DNS_TRACE("PosixEventEngine:%p creating NativeDNSResolver", |
|
|
|
this); |
|
|
|
this); |
|
|
|