Skip to content

Commit

Permalink
Check urlTest outbound for both networks (TCP/UDP)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashly-right committed Mar 21, 2024
1 parent feb24ff commit e1bf57f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions outbound/urltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,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
}
Expand All @@ -471,7 +472,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)
}
}
Expand Down

0 comments on commit e1bf57f

Please sign in to comment.