mirror of
https://github.com/fumiama/terasu.git
synced 2026-06-12 14:10:32 +08:00
fix(dns): disable false-positive deadline
This commit is contained in:
@@ -148,7 +148,7 @@ func (ds *DNSList) lookupHostDoH(ctx context.Context, host string) (hosts []stri
|
|||||||
return ErrSuccess
|
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
|
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)
|
conn, err = dialer.DialContext(ctx, "tcp", addr.a)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Debugln("[terasu.dns] -- dial tcp", host, addr, "err:", err)
|
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
|
addr.disable(time.Hour) // no need to acquire write lock
|
||||||
}
|
}
|
||||||
continue
|
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)
|
logrus.Debugln("[terasu.dns] -- hs tls", host, addr, "err:", err)
|
||||||
_ = tlsConn.Close()
|
_ = 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)
|
logrus.Debugln("[terasu.dns] == disable", host, addr)
|
||||||
addr.disable(time.Hour) // no need to acquire write lock
|
addr.disable(time.Hour) // no need to acquire write lock
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user