summaryrefslogtreecommitdiff
path: root/java/src/IceSSL/SslEndpointI.java
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2005-12-16 14:34:53 +0000
committerDwayne Boone <dwayne@zeroc.com>2005-12-16 14:34:53 +0000
commitb2baba63fc83c2602fea5bdeb9271a064e9a3f78 (patch)
treee2baa39d838234b494b156b344bc9ca12718a364 /java/src/IceSSL/SslEndpointI.java
parentFixed bug where new connections would get created when they shouldn't if (diff)
downloadice-b2baba63fc83c2602fea5bdeb9271a064e9a3f78.tar.bz2
ice-b2baba63fc83c2602fea5bdeb9271a064e9a3f78.tar.xz
ice-b2baba63fc83c2602fea5bdeb9271a064e9a3f78.zip
Fixed bug wrt hash calculation which did not take into effect hosts can be
different strings (ip or hostname) but still be equivalent.
Diffstat (limited to 'java/src/IceSSL/SslEndpointI.java')
-rw-r--r--java/src/IceSSL/SslEndpointI.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/java/src/IceSSL/SslEndpointI.java b/java/src/IceSSL/SslEndpointI.java
index d843a5b1678..710c6f6d531 100644
--- a/java/src/IceSSL/SslEndpointI.java
+++ b/java/src/IceSSL/SslEndpointI.java
@@ -556,7 +556,15 @@ final class SslEndpointI extends IceInternal.EndpointI
private void
calcHashValue()
{
- _hashCode = _host.hashCode();
+ try
+ {
+ java.net.InetAddress addr = java.net.InetAddress.getByName(_host);
+ _hashCode = addr.getHostAddress().hashCode();
+ }
+ catch(java.net.UnknownHostException ex)
+ {
+ _hashCode = _host.hashCode();
+ }
_hashCode = 5 * _hashCode + _port;
_hashCode = 5 * _hashCode + _timeout;
_hashCode = 5 * _hashCode + _connectionId.hashCode();