Implement suggested fix for cmdrate limiter. Resolves #1231.

This commit is contained in:
Griatch 2017-02-27 22:11:47 +01:00
parent d301ddd921
commit 86e0db7ea9

View file

@ -365,7 +365,7 @@ class PortalSessionHandler(SessionHandler):
pass
if session:
now = time.time()
if self.command_counter > _MAX_COMMAND_RATE:
if self.command_counter > _MAX_COMMAND_RATE > 0:
# data throttle (anti DoS measure)
dT = now - self.command_counter_reset
self.command_counter = 0