skip empty srv records

This commit is contained in:
Christian Schneppe 2018-02-10 19:38:40 +01:00
parent cf577ea140
commit ffba95da56

View file

@ -99,6 +99,9 @@ public class Resolver {
ResolverResult<SRV> result = resolveWithFallback(dnsName, SRV.class);
List<Result> results = new ArrayList<>();
for (SRV record : result.getAnswersOrEmptySet()) {
if (record.name.length() == 0 && record.priority == 0) {
continue;
}
final boolean addedIPv4 = results.addAll(resolveIp(record, A.class, result.isAuthenticData(), directTls));
results.addAll(resolveIp(record, AAAA.class, result.isAuthenticData(), directTls));
if (!addedIPv4 && !Thread.currentThread().isInterrupted()) {