geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r530539 - /geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java
Date Thu, 19 Apr 2007 20:49:18 GMT
Author: rickmcguire
Date: Thu Apr 19 13:49:17 2007
New Revision: 530539

URL: http://svn.apache.org/viewvc?view=rev&rev=530539
Log:
Fix IPv6 problem that causes connector to generate invalid URL. 


Modified:
    geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java

Modified: geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java?view=diff&rev=530539&r1=530538&r2=530539
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java
Thu Apr 19 13:49:17 2007
@@ -162,7 +162,7 @@
     public String getConnectUrl() {
         if(connectHost == null) {
             String host = getHost();
-            if(host == null || host.equals("0.0.0.0")) {
+            if(host == null || host.equals("0.0.0.0") || host.equals("0:0:0:0:0:0:0:1"))
{
                 InetAddress address = null;
                 try {
                     address = InetAddress.getLocalHost();
@@ -175,6 +175,11 @@
                         host = address.getHostAddress();
                     }
                 }
+            }
+            // this host address could be in IPv6 format, 
+            // which means we need to wrap it in brackets
+            if (host.indexOf(":") >= 0) {
+                host = "[" + host + "]"; 
             }
             connectHost = host;
         }



Mime
View raw message