Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Make Rate limiter configurable #3517
This makes the previously added rate limiter configurable. The change adds messagelimit and messageburst to the configuration file murmur.ini, the ServerDB as well as the ability to set these live. Because setting either of these to a value of 0 would render the Server unusable, both have a minimum of 1. The defaults are kept as before with a messagelimit of 1 and a messageburst of 5.
Though adjusting these live is entirely possible on the serverside, they currently only take effect for new connections. If they should take effect immediately for all present connections, I could add some more changes that allow that if you want.
I tested this change by printing either value on a new connection, as well as rapidly muting and unmuting myself with a messagelimit of 100 and a burstlimit of 500, without being able to get into any rate limit. Also setting either value to 0 in the murmur.ini, showed the expected 1 message per second with a maximum burst of 1 message. However this obviously felt very restricting, so I don't recommend it.
Please review the changes and tell me if I forgot something or made a mistake according to the coding style. Alternatively you can edit the change yourself if you prefer.
The two parameters should also be added and commented in