Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix off-by-one maxUsers check on session init #4292

Merged
merged 1 commit into from
Mar 21, 2021
Merged

fix off-by-one maxUsers check on session init #4292

merged 1 commit into from
Mar 21, 2021

Conversation

zachreizner
Copy link
Contributor

@zachreizner zachreizner commented Mar 21, 2021

The returned number of users from getUsersWithAddress will include the already connected user. The predicate >= maxUsers is incorrectly assuming that the new user is not already counted by getUsersWithAddress. This change corrects this off-by-one error by only closing connections after their are strictly too many users.

The returned number of users from `getUsersWithAddress` will include the already connected user. The predicate `>= maxUsers` is incorrectly assuming that the new user is not already counted by `getUsersWithAddress`. This change corrects this off-by-one error by only closing connections after their are strictly too many users.
@ZeldaZach
Copy link
Member

Ahh, nice catch! Thanks for the quick fix :)

@ZeldaZach ZeldaZach merged commit c5fac2e into Cockatrice:master Mar 21, 2021
@zachreizner zachreizner deleted the patch-1 branch March 21, 2021 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants