aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2015-04-16 21:55:52 +0200
committeriNPUTmice <daniel@gultsch.de>2015-04-16 22:06:41 +0200
commitdbe170bd353562c64d1d495e10a4d5ed80dfd233 (patch)
tree263d2102347ae9889d19384a4da4fedd1003724a /src/main/java
parent7eabdfd80f50634282307f45c5f99ab46181805d (diff)
fixed a bug in DNS helper code. fixes #1130
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/DNSHelper.java2
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java
index bcb2ca44..42dd1c95 100644
--- a/src/main/java/eu/siacs/conversations/utils/DNSHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/DNSHelper.java
@@ -121,7 +121,7 @@ public class DNSHelper {
while (p > 0) {
p -= s.get(i++).getPriority();
}
- i--;
+ if (i>0) i--;
// remove is expensive, but we have only a few entries
// anyway
SRV srv = s.remove(i);
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 48dc2150..b8e25d4b 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -204,7 +204,7 @@ public class XmppConnection implements Runnable {
&& "nosrv".equals(result.getString("error", null))) {
socket = new Socket(account.getServer().getDomainpart(), 5222);
} else {
- throw new IOException("timeout in dns");
+ throw new IOException("unhandled exception in DNS resolver");
}
final OutputStream out = socket.getOutputStream();
tagWriter.setOutputStream(out);