mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 18:48:00 +01:00
SMACK-225 Modified DNSUtils to return a default HostAddress when no DNS resolver is available. This restores the previous default behaviour.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13587 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
07a0b8f722
commit
999c86ef4c
1 changed files with 12 additions and 5 deletions
|
@ -81,7 +81,12 @@ public class DNSUtil {
|
||||||
* @return List of HostAddress, which encompasses the hostname and port that the
|
* @return List of HostAddress, which encompasses the hostname and port that the
|
||||||
* XMPP server can be reached at for the specified domain.
|
* XMPP server can be reached at for the specified domain.
|
||||||
*/
|
*/
|
||||||
public static List<HostAddress> resolveXMPPDomain(String domain) {
|
public static List<HostAddress> resolveXMPPDomain(final String domain) {
|
||||||
|
if (dnsResolver == null) {
|
||||||
|
List<HostAddress> addresses = new ArrayList<HostAddress>(1);
|
||||||
|
addresses.add(new HostAddress(domain, 5222));
|
||||||
|
return addresses;
|
||||||
|
}
|
||||||
return resolveDomain(domain, 'c');
|
return resolveDomain(domain, 'c');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +107,12 @@ public class DNSUtil {
|
||||||
* @return List of HostAddress, which encompasses the hostname and port that the
|
* @return List of HostAddress, which encompasses the hostname and port that the
|
||||||
* XMPP server can be reached at for the specified domain.
|
* XMPP server can be reached at for the specified domain.
|
||||||
*/
|
*/
|
||||||
public static List<HostAddress> resolveXMPPServerDomain(String domain) {
|
public static List<HostAddress> resolveXMPPServerDomain(final String domain) {
|
||||||
|
if (dnsResolver == null) {
|
||||||
|
List<HostAddress> addresses = new ArrayList<HostAddress>(1);
|
||||||
|
addresses.add(new HostAddress(domain, 5269));
|
||||||
|
return addresses;
|
||||||
|
}
|
||||||
return resolveDomain(domain, 's');
|
return resolveDomain(domain, 's');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,9 +127,6 @@ public class DNSUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dnsResolver == null)
|
|
||||||
throw new IllegalStateException("No DNS resolver active.");
|
|
||||||
|
|
||||||
List<HostAddress> addresses = new ArrayList<HostAddress>();
|
List<HostAddress> addresses = new ArrayList<HostAddress>();
|
||||||
|
|
||||||
// Step one: Do SRV lookups
|
// Step one: Do SRV lookups
|
||||||
|
|
Loading…
Reference in a new issue