fixed a bug in DNS helper code. fixes #1130
This commit is contained in:
parent
584ffbd000
commit
c4daa08170
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue