From: fhanik Date: Tue, 15 Jan 2008 19:34:10 +0000 (+0000) Subject: Add in the ability to turn off reverse DNS lookups for membership on a global scale. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=394cd4d7eabe79bd3b333ec09346e8ad9dd309b6;p=tomcat7.0 Add in the ability to turn off reverse DNS lookups for membership on a global scale. alot of system aren't configured for this, so simple debugging or warn messages that try to print the name, cause timeouts git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@612192 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/tribes/membership/MemberImpl.java b/java/org/apache/catalina/tribes/membership/MemberImpl.java index 0e5479a67..c1e5ce1d9 100644 --- a/java/org/apache/catalina/tribes/membership/MemberImpl.java +++ b/java/org/apache/catalina/tribes/membership/MemberImpl.java @@ -37,6 +37,11 @@ import org.apache.catalina.tribes.transport.SenderState; public class MemberImpl implements Member, java.io.Externalizable { /** + * Should a call to getName or getHostName try to do a DNS lookup? + * default is false + */ + public static final boolean DO_DNS_LOOKUPS = Boolean.parseBoolean(System.getProperty("org.apache.catalina.tribes.dns_lookups","false")); + /** * Public properties specific to this implementation */ public static final transient String TCP_LISTEN_PORT = "tcpListenPort"; @@ -430,7 +435,10 @@ public class MemberImpl implements Member, java.io.Externalizable { if ( this.hostname != null ) return hostname; else { try { - this.hostname = java.net.InetAddress.getByAddress(host).getHostName(); + if (DO_DNS_LOOKUPS) + this.hostname = java.net.InetAddress.getByAddress(host).getHostName(); + else + this.hostname = org.apache.catalina.tribes.util.Arrays.toString(host); return this.hostname; }catch ( IOException x ) { throw new RuntimeException("Unable to parse hostname.",x);