mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 09:56:47 +00:00
fix: dualStackDialContext not close the fallback connection when the preferred IP family won
This commit is contained in:
1 parent
27efee2dc7
commit
26edbaae0b
1 file changed
+5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user