diff --git a/dns/dns.go b/dns/dns.go index 03a75f4..6c6ad0a 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -148,7 +148,7 @@ func (ds *DNSList) lookupHostDoH(ctx context.Context, host string) (hosts []stri return ErrSuccess } } - if !errors.Is(err, context.DeadlineExceeded) && !errors.Is(err, context.Canceled) { + if !errors.Is(err, context.Canceled) { addr.disable(time.Hour) // no need to acquire write lock } } @@ -195,7 +195,7 @@ func (ds *DNSList) DialContext(ctx context.Context, dialer *net.Dialer, firstFra conn, err = dialer.DialContext(ctx, "tcp", addr.a) if err != nil { logrus.Debugln("[terasu.dns] -- dial tcp", host, addr, "err:", err) - if !errors.Is(err, context.DeadlineExceeded) && !errors.Is(err, context.Canceled) { + if !errors.Is(err, context.Canceled) { addr.disable(time.Hour) // no need to acquire write lock } continue @@ -230,7 +230,7 @@ func (ds *DNSList) DialContext(ctx context.Context, dialer *net.Dialer, firstFra } logrus.Debugln("[terasu.dns] -- hs tls", host, addr, "err:", err) _ = tlsConn.Close() - if !errors.Is(err, context.DeadlineExceeded) && !errors.Is(err, context.Canceled) { + if !errors.Is(err, context.Canceled) { logrus.Debugln("[terasu.dns] == disable", host, addr) addr.disable(time.Hour) // no need to acquire write lock }