diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-11-11 15:37:04 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-11-11 15:37:04 +0100 |
commit | 9c98f68b133a514f2cc501315f130d7e3e4ec76c (patch) | |
tree | edb56f34f3cdbec3c0017930587b53070bd62f20 /zkfacade | |
parent | dda9ca0f3b0f677b205a54cf2d99261305154425 (diff) |
Allow the name of localhost
Diffstat (limited to 'zkfacade')
-rw-r--r-- | zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java b/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java index d9c85f0cd1b..4c30e125d74 100644 --- a/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java +++ b/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java @@ -1,6 +1,7 @@ package com.yahoo.vespa.zookeeper; import com.google.common.collect.ImmutableSet; +import com.yahoo.net.HostName; import org.apache.zookeeper.server.NIOServerCnxn; import org.apache.zookeeper.server.NIOServerCnxnFactory; @@ -9,9 +10,7 @@ import java.net.InetSocketAddress; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.util.HashSet; -import java.util.Optional; import java.util.Set; -import java.util.logging.Level; import java.util.logging.Logger; /** @@ -67,6 +66,7 @@ public class RestrictedServerCnxnFactory extends NIOServerCnxnFactory { private boolean isLocalHost(String remoteHost) { if (remoteHost.equals("localhost")) return true; if (remoteHost.equals("localhost.localdomain")) return true; + if (remoteHost.equals(HostName.getLocalhost())) return true; return false; } |