fix: dualStackDialContext not close the fallback connection when the preferred IP family won

This commit is contained in:
kasumikira authored and wwqgtxx committed 2026-06-30 18:56:53 +08:00
1 parent 27efee2dc7
commit 26edbaae0b
1 file changed
+5
+5
View File
@@ -272,6 +272,11 @@ loop:
}
if res.error == nil {
if res.isPrimary {
if fallback.error == nil && fallback.Conn != nil {
go func() { // close fallback connection in new goroutine to avoid blocking
_ = fallback.Conn.Close()
}()
}
return res.Conn, nil
}
fallback = res