diff options
Diffstat (limited to 'cpp/src/Ice/TcpEndpoint.cpp')
-rw-r--r-- | cpp/src/Ice/TcpEndpoint.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/cpp/src/Ice/TcpEndpoint.cpp b/cpp/src/Ice/TcpEndpoint.cpp index 6e76d8b5293..6712ae08213 100644 --- a/cpp/src/Ice/TcpEndpoint.cpp +++ b/cpp/src/Ice/TcpEndpoint.cpp @@ -330,9 +330,17 @@ IceInternal::TcpEndpoint::operator==(const Endpoint& r) const // struct sockaddr_in laddr; struct sockaddr_in raddr; - getAddress(_host, _port, laddr); - getAddress(p->_host, p->_port, raddr); - return compareAddress(laddr, raddr); + try + { + getAddress(_host, _port, laddr); + getAddress(p->_host, p->_port, raddr); + } + catch(const DNSException&) + { + return false; + } + + return compareAddress(laddr, raddr); } return true; @@ -391,9 +399,23 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const // We do the most time-consuming part of the comparison last. // struct sockaddr_in laddr; + try + { + getAddress(_host, _port, laddr); + } + catch(const DNSException&) + { + } + struct sockaddr_in raddr; - getAddress(_host, _port, laddr); - getAddress(p->_host, p->_port, raddr); + try + { + getAddress(p->_host, p->_port, raddr); + } + catch(const DNSException&) + { + } + if(laddr.sin_addr.s_addr < raddr.sin_addr.s_addr) { return true; |