Update xtransport.go

This commit is contained in:
ACE 2025-01-25 20:59:29 +02:00 committed by GitHub
parent e4fc6d6fd0
commit ba52f8897b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -414,23 +414,22 @@ func (xTransport *XTransport) resolveAndUpdateCache(host string) error {
if xTransport.mainProto == "tcp" {
protos = []string{"tcp", "udp"}
}
if xTransport.ignoreSystemDNS {
if xTransport.internalResolverReady {
for _, proto := range protos {
foundIP, ttl, err = xTransport.resolveUsingResolvers(proto, host, xTransport.internalResolvers)
if err == nil {
break
}
if xTransport.internalResolverReady {
for _, proto := range protos {
foundIP, ttl, err = xTransport.resolveUsingResolvers(proto, host, xTransport.internalResolvers)
if err == nil {
break
}
} else {
err = errors.New("Service is not usable yet")
dlog.Notice(err)
}
} else {
foundIP, ttl, err = xTransport.resolveUsingSystem(host)
if err != nil {
err = errors.New("System DNS is not usable yet")
dlog.Notice(err)
err = errors.New("Service is not usable yet")
dlog.Notice(err)
if xTransport.ignoreSystemDNS == false {
foundIP, ttl, err = xTransport.resolveUsingSystem(host)
if err != nil {
err = errors.New("System DNS is not usable yet")
dlog.Notice(err)
}
}
}
if err != nil {