resolve: https://issues.apache.org/activemq/browse/AMQ-2776 - apply variant of patch. also related to https://issues.apache.org/activemq/browse/AMQ-2771, avoid unnecessary local host name resolution

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@983565 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2010-08-09 09:38:46 +00:00
parent 7f7a95b457
commit 670a9c4c56
1 changed files with 3 additions and 3 deletions

View File

@ -399,9 +399,9 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
// Implementation methods
// -------------------------------------------------------------------------
protected String resolveHostName(String host) throws UnknownHostException {
String localName = InetAddress.getLocalHost().getHostName();
if (localName != null && isUseLocalHost()) {
if (localName.equals(host)) {
if (isUseLocalHost()) {
String localName = InetAddress.getLocalHost().getHostName();
if (localName != null && localName.equals(host)) {
return "localhost";
}
}