From 20ef225c9690f1aa4c116714a1de59a05461992f Mon Sep 17 00:00:00 2001 From: Doodle <13706157+critical27@users.noreply.github.com> Date: Thu, 11 Mar 2021 11:39:43 +0800 Subject: [PATCH] address @panda-sheep's comments --- src/common/thrift/ThriftClientManager.inl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/common/thrift/ThriftClientManager.inl b/src/common/thrift/ThriftClientManager.inl index fc4809187..b61531c3e 100644 --- a/src/common/thrift/ThriftClientManager.inl +++ b/src/common/thrift/ThriftClientManager.inl @@ -51,14 +51,13 @@ std::shared_ptr ThriftClientManager::client( * TODO(liuyu): folly said 'resolve' may take second to finish * if this really happen, we will add a cache here. * */ - HostAddr tempHost = host; - if (!folly::IPAddress::validate(tempHost.host)) { + if (!folly::IPAddress::validate(host.host)) { try { - folly::SocketAddress socketAddr(tempHost.host, tempHost.port, true); + folly::SocketAddress socketAddr(host.host, host.port, true); std::ostringstream oss; - oss << "resolve " << tempHost << " as "; - tempHost.host = socketAddr.getAddressStr(); - oss << tempHost; + oss << "resolve " << host << " as "; + host.host = socketAddr.getAddressStr(); + oss << host; LOG(INFO) << oss.str(); } catch(const std::exception& e) { LOG(ERROR) << e.what();