aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-08-01 12:04:17 +0200
committerChristian Schneppe <christian@pix-art.de>2017-08-01 12:04:17 +0200
commit68f8d0ac8524417ae44cfac4286397bcdf6c4045 (patch)
tree8b3d145b0ad60f105ece734ef10463e124bef5ae /src/main/java
parentc32590697cea9cc8b7bdd586e5f4791bdec4fef5 (diff)
catch all exceptions around minidns :(
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/utils/Resolver.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/Resolver.java b/src/main/java/de/pixart/messenger/utils/Resolver.java
index d6572aed6..d8582dbbf 100644
--- a/src/main/java/de/pixart/messenger/utils/Resolver.java
+++ b/src/main/java/de/pixart/messenger/utils/Resolver.java
@@ -56,7 +56,7 @@ public class Resolver {
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": " + e.getMessage());
}
if (results.size() == 0) {
- results.addAll(resolveFallback(DNSName.from(domain), true));
+ results.addAll(resolveNoSrvRecords(DNSName.from(domain), true));
}
Collections.sort(results);
Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": " + results.toString());
@@ -101,7 +101,7 @@ public class Resolver {
return list;
}
- private static List<Result> resolveFallback(DNSName dnsName, boolean withCnames) {
+ private static List<Result> resolveNoSrvRecords(DNSName dnsName, boolean withCnames) {
List<Result> results = new ArrayList<>();
try {
for (A a : resolveWithFallback(dnsName, A.class, false).getAnswersOrEmptySet()) {
@@ -110,13 +110,13 @@ public class Resolver {
for (AAAA aaaa : resolveWithFallback(dnsName, AAAA.class, false).getAnswersOrEmptySet()) {
results.add(Result.createDefault(dnsName, aaaa.getInetAddress()));
}
- if (results.size() == 0) {
+ if (results.size() == 0 && withCnames) {
for (CNAME cname : resolveWithFallback(dnsName, CNAME.class, false).getAnswersOrEmptySet()) {
- results.addAll(resolveFallback(cname.name, false));
+ results.addAll(resolveNoSrvRecords(cname.name, false));
}
}
- } catch (IOException e) {
- Log.d(Config.LOGTAG, "error resolving fallback records " + e);
+ } catch (Throwable throwable) {
+ Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + "error resolving fallback records", throwable);
}
if (results.size() == 0) {
results.add(Result.createDefault(dnsName));