1
0
mirror of https://github.com/fumiama/terasu.git synced 2026-06-28 08:40:24 +08:00

fix(dns): tls.Conn.Handshake panic

This commit is contained in:
源文雨
2025-10-06 01:17:29 +08:00
parent 812043a905
commit 614a6d88d4

View File

@@ -173,8 +173,10 @@ func (ds *DNSList) DialContext(ctx context.Context, dialer *net.Dialer, firstFra
defer cancel() defer cancel()
} }
conn, err = dialer.DialContext(ctx, "tcp", addr.a) conn, err = dialer.DialContext(ctx, "tcp", addr.a)
if err != nil && !errors.Is(err, context.DeadlineExceeded) && !errors.Is(err, context.Canceled) { if err != nil {
addr.disable(time.Hour) // no need to acquire write lock if !errors.Is(err, context.DeadlineExceeded) && !errors.Is(err, context.Canceled) {
addr.disable(time.Hour) // no need to acquire write lock
}
continue continue
} }
tlsConn = tls.Client(conn, &tls.Config{ServerName: host}) tlsConn = tls.Client(conn, &tls.Config{ServerName: host})