mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 08:27:39 +08:00
reverseproxy: Fix least_conn
policy regression (#5862)
This commit is contained in:
parent
a8586b05aa
commit
e8b8d4a8cd
|
@ -269,7 +269,7 @@ func (LeastConnSelection) Select(pool UpstreamPool, _ *http.Request, _ http.Resp
|
||||||
// sample: https://en.wikipedia.org/wiki/Reservoir_sampling
|
// sample: https://en.wikipedia.org/wiki/Reservoir_sampling
|
||||||
if numReqs == leastReqs {
|
if numReqs == leastReqs {
|
||||||
count++
|
count++
|
||||||
if count > 1 || (weakrand.Int()%count) == 0 { //nolint:gosec
|
if count == 1 || (weakrand.Int()%count) == 0 { //nolint:gosec
|
||||||
bestHost = host
|
bestHost = host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user