diff options
author | Alex Clayton <alex.clayton@isode.com> | 2013-09-19 08:37:01 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2013-09-19 14:29:03 (GMT) |
commit | 67a850e665a17c77afce52597aec004e0c1aa8ea (patch) | |
tree | 410af3f54827aeea4445a3c9fd16563e1bd96a2a /src | |
parent | 8a2351e0ddb9bcb9974b1015c1858bd7545bfe28 (diff) | |
download | stroke-67a850e665a17c77afce52597aec004e0c1aa8ea.zip stroke-67a850e665a17c77afce52597aec004e0c1aa8ea.tar.bz2 |
Fix PlatformDomainNameResolve DomainNameAddressQuery
In the PlatformDomainNameResolver class there is a DomainNameAddressQuery
class (accesible via DomainNameResolver->createAddressQuery()) for
performing a DNS lookup on a given domainname. This should have been
returing the set of all HostAddress associated with a given domain, but
instead was only returning a singleton set (or empty if there was no dns).
This patch fixes this by changing the method call from
InetAddress.getByName() to InetAddress.getAllByName().
Test-information:
Tested on top of my MLC Diagnose SRV patch. For 'google.com' we now see a
full list of ip addresses associated with it, rather then just the one.
Change-Id: I6e57c16bb64f76048f16bcff8ee9c1924049a051
Diffstat (limited to 'src')
-rw-r--r-- | src/com/isode/stroke/network/PlatformDomainNameResolver.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/isode/stroke/network/PlatformDomainNameResolver.java b/src/com/isode/stroke/network/PlatformDomainNameResolver.java index ccdee6d..3eef682 100644 --- a/src/com/isode/stroke/network/PlatformDomainNameResolver.java +++ b/src/com/isode/stroke/network/PlatformDomainNameResolver.java @@ -25,7 +25,9 @@ public class PlatformDomainNameResolver extends DomainNameResolver { public void run() { final Collection<HostAddress> results = new ArrayList<HostAddress>(); try { - results.add(new HostAddress(InetAddress.getByName(hostname))); + for (InetAddress result : InetAddress.getAllByName(hostname)) { + results.add(new HostAddress(result)); + } } catch (UnknownHostException ex) { } eventLoop.postEvent(new Callback() { |