From 3d0e9f38cb532b94f2d6b6007b4b596e8ba7a182 Mon Sep 17 00:00:00 2001 From: Hugefiver Date: Fri, 12 Jul 2024 18:21:06 +0800 Subject: [PATCH] update readme --- README.md | 2 +- ssh.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13ba27e..4350efc 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ The format of `-maxconn` and `-maxsuccconn` is `max:loss_ratio:hard_max`, and th It means when the count of connections mathes `max`, it will loss the connection with the ratio. And the ratio will increase literally, and it will be `1.0` when connections equal or larger than `hard_max`. * `max` is interger, optional means `0`: - * `max < 0` => unlimited connections. + * `max < 0` => unlimited connections, unless `hard_max`. * `max = 0` => use program default value, current is `100` for `maxconn` and `unlimited` for `maxsuccconn`. * `loss_ratio` is float, optional means `0`: * `loss_ratio < 0` => not loss connections until it reaches `hard_max`. diff --git a/ssh.go b/ssh.go index c5d5207..02d67d6 100644 --- a/ssh.go +++ b/ssh.go @@ -239,7 +239,7 @@ func checkMaxConnections(curr, max, hardMax int64, ratio float64) bool { return false } - if ratio <= 0 { + if ratio < 0 { return curr <= hardMax } else if ratio >= 1 { return ratio <= 0