mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
08.23.2014 4ca2a9a3650344ed74e55c1bdb646dc88cf91965
refs
author Matthew Swift <matthew.swift@forgerock.com>
Wednesday, January 8, 2014 15:23 +0100
committer Matthew Swift <matthew.swift@forgerock.com>
Wednesday, January 8, 2014 15:23 +0100
commit4ca2a9a3650344ed74e55c1bdb646dc88cf91965
tree ad814a69ffcba9f36777df18586269e284156a5f tree | zip | gz
parent b31a5ca2393d583b567ab02d69b5350b1f665a10 view | diff
Fix OPENDJ-1270: Avoid unnecessary DNS lookups when performing bind requests

* rename LDAP{ConnectionFactory|Listener}.getHostname() to getHostName()
* change LDAP{ConnectionFactory|Listener}.getAddress() to return InetSocketAddresses
* change constructors to only accept InetSocketAddresses instead of more generic SocketAddress
* ensure that LDAP{ConnectionFactory|Listener}.getAddress() returns an address which represents the exact socket address passed in during construction, except in the case where a listener is created with port 0 where we return the selected port
* modify LDAP{ConnectionFactory|Listener}.getHostName() to return whatever was provided as the host name during construction, which may have been a raw IP address. This avoids attempts to perform a reverse DNS lookup in the case where the provided host name was an IP address and, in particular, avoids DNS timeouts in environments where there is no DNS
* modify client bind processing to use LDAPConnectionFactory.getHostName() as the server name used for SASL authentication, and avoid any potential DNS delays as a result.
9 files modified
213 ■■■■ changed files
opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java 10 ●●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnectionFactoryImpl.java 10 ●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPListenerImpl.java 20 ●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/main/java/com/forgerock/opendj/util/StaticUtils.java 46 ●●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java 49 ●●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPListener.java 54 ●●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/test/java/com/forgerock/opendj/ldap/LDAPConnectionTestCase.java 6 ●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/LDAPServer.java 10 ●●●● diff | view | raw | blame | history
opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/TestCaseUtils.java 8 ●●●● diff | view | raw | blame | history