Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
address @panda-sheep's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
critical27 committed Mar 11, 2021
1 parent 7d27ebc commit 20ef225
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/common/thrift/ThriftClientManager.inl
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ std::shared_ptr<ClientType> ThriftClientManager<ClientType>::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();
Expand Down

0 comments on commit 20ef225

Please sign in to comment.