Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hugefiver committed Jul 12, 2024
1 parent e24d337 commit 3d0e9f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3d0e9f3

Please sign in to comment.