Fix c-ares resolver to properly handle error from SplitHostPort().

pull/22817/head
Mark D. Roth 5 years ago
parent 8a14958980
commit ffd7b27577
  1. 3
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc

@ -467,8 +467,7 @@ static bool inner_resolve_as_ip_literal_locked(
const char* name, const char* default_port, const char* name, const char* default_port,
std::unique_ptr<grpc_core::ServerAddressList>* addrs, std::string* host, std::unique_ptr<grpc_core::ServerAddressList>* addrs, std::string* host,
std::string* port, std::string* hostport) { std::string* port, std::string* hostport) {
grpc_core::SplitHostPort(name, host, port); if (!grpc_core::SplitHostPort(name, host, port)) {
if (host->empty()) {
gpr_log(GPR_ERROR, gpr_log(GPR_ERROR,
"Failed to parse %s to host:port while attempting to resolve as ip " "Failed to parse %s to host:port while attempting to resolve as ip "
"literal.", "literal.",

Loading…
Cancel
Save