From 78a388f8731c2e9d7b5e643bc1592132ff667fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 6 Oct 2025 14:10:17 +0800 Subject: [PATCH] fix(dns): disable false-positive deadline --- dns/dns.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 }