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:
@@ -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})
|
||||||
|
|||||||
Reference in New Issue
Block a user