1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00

fix selectLeastLoad() returns wrong number of nodes (#2083)

This commit is contained in:
Jebbs 2022-10-20 12:00:21 +08:00 committed by GitHub
parent 0cd219fdc5
commit f9422d60aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,8 +118,8 @@ func (l *LeastLoadStrategy) selectLeastLoad(nodes []*node) []*node {
// go through all base line until find expected selects
for _, b := range l.settings.Baselines {
baseline := time.Duration(b)
for i := 0; i < availableCount; i++ {
if nodes[i].RTTDeviationCost > baseline {
for i := count; i < availableCount; i++ {
if nodes[i].RTTDeviationCost >= baseline {
break
}
count = i + 1