From 50410dad334643945e4978117d81dc3cbf4c3157 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sun, 14 Dec 2014 18:31:52 +0100 Subject: possible dns fixes --- src/main/java/eu/siacs/conversations/utils/DNSHelper.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/utils') diff --git a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java index 8c1a8dea3..2aa6f5738 100644 --- a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java @@ -143,12 +143,21 @@ public class DNSHelper { Bundle namePort = new Bundle(); namePort.putString("name", srv.getName()); namePort.putInt("port", srv.getPort()); + if (ips6.containsKey(srv.getName())) { + ArrayList ip = ips6.get(srv.getName()); + Collections.shuffle(ip, rnd); + namePort.putString("ip", ip.get(0)); + values.add(namePort); + } if (ips4.containsKey(srv.getName())) { ArrayList ip = ips4.get(srv.getName()); Collections.shuffle(ip, rnd); - namePort.putString("ipv4", ip.get(0)); + namePort.putString("ip", ip.get(0)); + values.add(namePort); + } + if (!ips6.containsKey(srv.getName()) && !ips4.containsKey(srv.getName())) { + values.add(namePort); } - values.add(namePort); } bundle.putParcelableArrayList("values", values); } catch (SocketTimeoutException e) { -- cgit v1.2.3