activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r515084 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
Date Tue, 06 Mar 2007 11:47:49 GMT
Author: jstrachan
Date: Tue Mar  6 03:47:32 2007
New Revision: 515084

URL: http://svn.apache.org/viewvc?view=rev&rev=515084
Log:
Fix for AMQ-1188 to handle invalid URIs for host names on Linux

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java?view=diff&rev=515084&r1=515083&r2=515084
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
Tue Mar  6 03:47:32 2007
@@ -91,8 +91,16 @@
 			setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(bind.getHost()),
serverSocket.getLocalPort(), bind.getPath(),
 					bind.getQuery(), bind.getFragment()));
 		} catch (URISyntaxException e) {
-			throw IOExceptionSupport.create(e);
-		}
+
+            // it could be that the host name contains invalid characters such as _ on unix
platforms
+            // so lets try use the IP address instead
+            try {
+                setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), addr.getHostAddress(),
serverSocket.getLocalPort(), bind.getPath(),
+                        bind.getQuery(), bind.getFragment()));
+            } catch (URISyntaxException e2) {
+                throw IOExceptionSupport.create(e2);
+            }
+        }
     }
     
     /**



Mime
View raw message