|
@@ -524,11 +524,12 @@ public class DFSClient implements java.io.Closeable {
|
|
|
private static boolean isLocalAddress(InetSocketAddress targetAddr) {
|
|
|
InetAddress addr = targetAddr.getAddress();
|
|
|
Boolean cached = localAddrMap.get(addr.getHostAddress());
|
|
|
- if (cached != null && cached) {
|
|
|
+ if (cached != null) {
|
|
|
if (LOG.isTraceEnabled()) {
|
|
|
- LOG.trace("Address " + targetAddr + " is local");
|
|
|
+ LOG.trace("Address " + targetAddr +
|
|
|
+ (cached ? " is local" : " is not local"));
|
|
|
}
|
|
|
- return true;
|
|
|
+ return cached;
|
|
|
}
|
|
|
|
|
|
// Check if the address is any local or loop back
|
|
@@ -543,7 +544,8 @@ public class DFSClient implements java.io.Closeable {
|
|
|
}
|
|
|
}
|
|
|
if (LOG.isTraceEnabled()) {
|
|
|
- LOG.trace("Address " + targetAddr + " is local");
|
|
|
+ LOG.trace("Address " + targetAddr +
|
|
|
+ (local ? " is local" : " is not local"));
|
|
|
}
|
|
|
localAddrMap.put(addr.getHostAddress(), local);
|
|
|
return local;
|