Update dns_transaction.cc

This commit is contained in:
Alexander David Frick 2022-06-30 08:05:58 -05:00 committed by GitHub
parent 3f6bd4a00d
commit f975998071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1223,9 +1223,9 @@ class DnsTransactionImpl : public DnsTransaction,
}
std::string qname;
for (size_t i = 0; i < config.search.size(); ++i) {
for (const auto& suffix : config.search) {
// Ignore invalid (too long) combinations.
if (!DNSDomainFromDot(hostname_ + "." + config.search[i], &qname))
if (!DNSDomainFromDot(hostname_ + "." + suffix, &qname))
continue;
if (qname.size() == labeled_hostname.size()) {
if (had_hostname)
@ -1530,7 +1530,6 @@ class DnsTransactionImpl : public DnsTransaction,
result = StartQuery();
}
break;
case ERR_CONNECTION_REFUSED:
case ERR_DNS_TIMED_OUT:
timer_.Stop();