Author: fhanik Date: Tue Jan 15 11:34:10 2008 New Revision: 612192 URL: http://svn.apache.org/viewvc?rev=612192&view=rev Log: 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
Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java?rev=612192&r1=612191&r2=612192&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java Tue Jan 15 11:34:10 2008 @@ -37,6 +37,11 @@ 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 @@ 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); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]