From dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 10 Aug 2012 19:05:05 +0200 Subject: ICE-4702 - Poor hash algorithm --- cpp/src/Ice/TcpEndpointI.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cpp/src/Ice/TcpEndpointI.cpp') diff --git a/cpp/src/Ice/TcpEndpointI.cpp b/cpp/src/Ice/TcpEndpointI.cpp index e38885976fb..9c64b22057b 100644 --- a/cpp/src/Ice/TcpEndpointI.cpp +++ b/cpp/src/Ice/TcpEndpointI.cpp @@ -547,10 +547,15 @@ IceInternal::TcpEndpointI::operator<(const LocalObject& r) const Ice::Int IceInternal::TcpEndpointI::hashInit() const { - Ice::Int h = 0; + Ice::Int h = 5381; + hashAdd(h, TCPEndpointType); hashAdd(h, _host); hashAdd(h, _port); hashAdd(h, _timeout); + hashAdd(h, _protocol.major); + hashAdd(h, _protocol.minor); + hashAdd(h, _encoding.major); + hashAdd(h, _encoding.minor); hashAdd(h, _connectionId); hashAdd(h, _compress); return h; -- cgit v1.2.3