fix false error message

Fix false error message when only 1 resolver on second protocol
This commit is contained in:
ACE 2025-01-26 06:29:53 +02:00 committed by GitHub
parent 2d807ae432
commit d17e6ccc4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -383,10 +383,8 @@ func (xTransport *XTransport) resolveUsingResolvers(
for i, resolver := range resolvers {
ip, ttl, err = xTransport.resolveUsingResolver(proto, host, resolver)
if err == nil {
if i > 0 {
dlog.Infof("Resolution succeeded with resolver %s[%s]", proto, resolver)
resolvers[0], resolvers[i] = resolvers[i], resolvers[0]
}
dlog.Infof("Resolution succeeded with resolver %s[%s]", proto, resolver)
resolvers[0], resolvers[i] = resolvers[i], resolvers[0]
break
}
dlog.Infof("Unable to resolve [%s] using resolver [%s] (%s): %v", host, resolver, proto, err)