fixed a bug in DNS helper code. fixes #1130

This commit is contained in:
iNPUTmice 2015-04-16 21:55:52 +02:00
parent 7eabdfd80f
commit dbe170bd35
2 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ public class DNSHelper {
while (p > 0) { while (p > 0) {
p -= s.get(i++).getPriority(); p -= s.get(i++).getPriority();
} }
i--; if (i>0) i--;
// remove is expensive, but we have only a few entries // remove is expensive, but we have only a few entries
// anyway // anyway
SRV srv = s.remove(i); SRV srv = s.remove(i);

View File

@ -204,7 +204,7 @@ public class XmppConnection implements Runnable {
&& "nosrv".equals(result.getString("error", null))) { && "nosrv".equals(result.getString("error", null))) {
socket = new Socket(account.getServer().getDomainpart(), 5222); socket = new Socket(account.getServer().getDomainpart(), 5222);
} else { } else {
throw new IOException("timeout in dns"); throw new IOException("unhandled exception in DNS resolver");
} }
final OutputStream out = socket.getOutputStream(); final OutputStream out = socket.getOutputStream();
tagWriter.setOutputStream(out); tagWriter.setOutputStream(out);