Fixed an issue where the IDLE_TIMEOUT was triggered even though one had been active in the interval.

This commit is contained in:
Griatch 2016-01-27 21:21:37 +01:00
parent 483263dda1
commit 418e6d953a

View file

@ -382,9 +382,9 @@ class PortalSessionHandler(SessionHandler):
#text = timetrace(text, "portalsessionhandler.data_in")
if session:
now = time()
if self.command_counter > _MAX_COMMAND_RATE:
# data throttle (anti DoS measure)
now = time()
dT = now - self.command_counter_reset
self.command_counter = 0
self.command_counter_reset = now
@ -396,6 +396,7 @@ class PortalSessionHandler(SessionHandler):
return
# relay data to Server
self.command_counter += 1
session.cmd_last = now
self.portal.amp_protocol.send_MsgPortal2Server(session,
text=text,
**kwargs)