Check urlTest outbound for both networks (TCP/UDP)

This commit is contained in:
ashly-right 2024-03-10 19:28:48 +01:00
parent 91e20525fa
commit 0ade3706a8
No known key found for this signature in database
GPG Key ID: 2C70FC9CFBECF3DE
1 changed files with 4 additions and 2 deletions

View File

@ -470,7 +470,8 @@ func (g *URLTestGroup) selectBestLatencyOutbounds() {
if bestTCPLatency == 0 || history.Delay < bestTCPLatency {
bestTCPLatency = history.Delay
}
} else if common.Contains(detour.Network(), N.NetworkUDP) {
}
if common.Contains(detour.Network(), N.NetworkUDP) {
if bestUDPLatency == 0 || history.Delay < bestUDPLatency {
bestUDPLatency = history.Delay
}
@ -485,7 +486,8 @@ func (g *URLTestGroup) selectBestLatencyOutbounds() {
if common.Contains(detour.Network(), N.NetworkTCP) && history.Delay <= bestTCPLatency+g.tolerance {
bestTCPOutbounds = append(bestTCPOutbounds, detour)
} else if common.Contains(detour.Network(), N.NetworkUDP) && history.Delay <= bestUDPLatency+g.tolerance {
}
if common.Contains(detour.Network(), N.NetworkUDP) && history.Delay <= bestUDPLatency+g.tolerance {
bestUDPOutbounds = append(bestUDPOutbounds, detour)
}
}