From c85b3bbaccdf03feecda87701c48ee2ba45241ac Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 26 Jun 2017 14:03:38 +0200 Subject: [PATCH] revised resolver strategy --- .../java/eu/siacs/conversations/utils/Resolver.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/Resolver.java b/src/main/java/eu/siacs/conversations/utils/Resolver.java index a8a7ffbc2..6c01f1743 100644 --- a/src/main/java/eu/siacs/conversations/utils/Resolver.java +++ b/src/main/java/eu/siacs/conversations/utils/Resolver.java @@ -13,7 +13,6 @@ import java.util.List; import de.measite.minidns.DNSClient; import de.measite.minidns.DNSName; import de.measite.minidns.dnssec.DNSSECResultNotAuthenticException; -import de.measite.minidns.dnssec.DNSSECValidationFailedException; import de.measite.minidns.hla.DnssecResolverApi; import de.measite.minidns.hla.ResolverApi; import de.measite.minidns.hla.ResolverResult; @@ -95,8 +94,13 @@ public class Resolver { private static ResolverResult resolveWithFallback(DNSName dnsName, Class type) throws IOException { try { return DnssecResolverApi.INSTANCE.resolveDnssecReliable(dnsName, type); - } catch (DNSSECValidationFailedException | DNSSECResultNotAuthenticException e) { - Log.d(Config.LOGTAG,Resolver.class.getSimpleName()+": error resolving "+type.getSimpleName()+" with DNSSEC. Trying DNS instead "+e.getMessage()); + } catch (DNSSECResultNotAuthenticException e) { + Log.d(Config.LOGTAG,Resolver.class.getSimpleName()+": error resolving "+type.getSimpleName()+" with DNSSEC. Trying DNS instead.",e); + return ResolverApi.INSTANCE.resolve(dnsName, type); + } catch (IOException e) { + throw e; + } catch (Throwable throwable) { + Log.d(Config.LOGTAG,Resolver.class.getSimpleName()+": error resolving "+type.getSimpleName()+" with DNSSEC. Trying DNS instead.",throwable); return ResolverApi.INSTANCE.resolve(dnsName, type); } }