if (aRecords == null) {
try {
DNSRequest request = new DNSRequest(host, DNSRequest.A);
return new DNSLookupContinuation(request, AMechanism.this);
} catch (NoneException e) {
return onDNSResponse(new DNSResponse(aRecords), spfData);
}
} else {
return onDNSResponse(new DNSResponse(aRecords), spfData);
}
} else {
List<String> aaaaRecords = getAAAARecords(host);
if (aaaaRecords == null) {
try {
DNSRequest request = new DNSRequest(host, DNSRequest.AAAA);
return new DNSLookupContinuation(request, AMechanism.this);
} catch (NoneException e) {
return onDNSResponse(new DNSResponse(aaaaRecords), spfData);
}
} else {
return onDNSResponse(new DNSResponse(aaaaRecords), spfData);
}
}
// PermError / TempError
// TODO: Should we replace this with the "right" Exceptions ?