resolver results need to be editable if we inject see-other-host
This commit is contained in:
parent
d175843cbd
commit
a62a7a4a84
|
@ -166,15 +166,15 @@ public class Resolver {
|
|||
threads[2].interrupt();
|
||||
synchronized (results) {
|
||||
Collections.sort(results);
|
||||
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": " + results.toString());
|
||||
return new ArrayList<>(results);
|
||||
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": " + results);
|
||||
return results;
|
||||
}
|
||||
} else {
|
||||
threads[2].join();
|
||||
synchronized (fallbackResults) {
|
||||
Collections.sort(fallbackResults);
|
||||
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": " + fallbackResults.toString());
|
||||
return new ArrayList<>(fallbackResults);
|
||||
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": " + fallbackResults);
|
||||
return fallbackResults;
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
|
@ -257,7 +257,7 @@ public class Resolver {
|
|||
}
|
||||
|
||||
private static List<Result> resolveNoSrvRecords(DNSName dnsName, boolean withCnames) {
|
||||
List<Result> results = new ArrayList<>();
|
||||
final List<Result> results = new ArrayList<>();
|
||||
try {
|
||||
for (A a : resolveWithFallback(dnsName, A.class, false).getAnswersOrEmptySet()) {
|
||||
results.add(Result.createDefault(dnsName, a.getInetAddress()));
|
||||
|
|
|
@ -338,12 +338,13 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
} else {
|
||||
final String domain = account.getServer();
|
||||
final List<Resolver.Result> results;
|
||||
final List<Resolver.Result> results = new ArrayList<>();
|
||||
final boolean hardcoded = extended && !account.getHostname().isEmpty();
|
||||
if (hardcoded) {
|
||||
results = Resolver.fromHardCoded(account.getHostname(), account.getPort());
|
||||
results.addAll(
|
||||
Resolver.fromHardCoded(account.getHostname(), account.getPort()));
|
||||
} else {
|
||||
results = Resolver.resolve(domain);
|
||||
results.addAll(Resolver.resolve(domain));
|
||||
}
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": Thread was interrupted");
|
||||
|
|
Loading…
Reference in a new issue