mirror of https://github.com/apache/activemq.git
Fix for AMQ-1188 to handle invalid URIs for host names on Linux
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@515084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4bef5e3599
commit
8011f907ef
|
@ -91,8 +91,16 @@ public class TcpTransportServer extends TransportServerThreadSupport {
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue