diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-03-25 18:12:27 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-03-25 18:12:27 +0100 |
commit | 956b646e2a02130d45d59efa8dbac5c1daabb255 (patch) | |
tree | 854ecfc8172698079f7ca511f8f449da3d9783e6 /src/eu/siacs/conversations | |
parent | 0b9e089ac63b0743619893e30c4c612516661b23 (diff) |
more srv lookup fixes
Diffstat (limited to 'src/eu/siacs/conversations')
-rw-r--r-- | src/eu/siacs/conversations/utils/DNSHelper.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/utils/DNSHelper.java b/src/eu/siacs/conversations/utils/DNSHelper.java index c20b45ecc..d28a727c5 100644 --- a/src/eu/siacs/conversations/utils/DNSHelper.java +++ b/src/eu/siacs/conversations/utils/DNSHelper.java @@ -96,12 +96,23 @@ public class DNSHelper { ++i; } builder.replace(0, 1, ""); + + //TODO: workaround. speak proper dns later + if (!builder.toString().contains(".")) { + namePort.putString("error", "nosrv"); + return namePort; + } namePort.putString("name",builder.toString()); return namePort; } static int calcPort(byte hb, byte lb) { - return ((int) hb << 8) | ((int) lb & 0xFF); + int port = ((int) hb << 8) | ((int) lb & 0xFF); + if (port>=0) { + return port; + } else { + return 65536 + port; + } } final protected static char[] hexArray = "0123456789ABCDEF".toCharArray(); |