pull/35153/head
yijiem 12 months ago
parent 001f44bd7d
commit a4107f7d81
  1. 4
      src/core/lib/event_engine/posix_engine/posix_engine.cc

@ -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);

Loading…
Cancel
Save