Fixed an issue where the IDLE_TIMEOUT was triggered even though one had been active in the interval.
This commit is contained in:
parent
483263dda1
commit
418e6d953a
1 changed files with 2 additions and 1 deletions
|
|
@ -382,9 +382,9 @@ class PortalSessionHandler(SessionHandler):
|
||||||
#text = timetrace(text, "portalsessionhandler.data_in")
|
#text = timetrace(text, "portalsessionhandler.data_in")
|
||||||
|
|
||||||
if session:
|
if session:
|
||||||
|
now = time()
|
||||||
if self.command_counter > _MAX_COMMAND_RATE:
|
if self.command_counter > _MAX_COMMAND_RATE:
|
||||||
# data throttle (anti DoS measure)
|
# data throttle (anti DoS measure)
|
||||||
now = time()
|
|
||||||
dT = now - self.command_counter_reset
|
dT = now - self.command_counter_reset
|
||||||
self.command_counter = 0
|
self.command_counter = 0
|
||||||
self.command_counter_reset = now
|
self.command_counter_reset = now
|
||||||
|
|
@ -396,6 +396,7 @@ class PortalSessionHandler(SessionHandler):
|
||||||
return
|
return
|
||||||
# relay data to Server
|
# relay data to Server
|
||||||
self.command_counter += 1
|
self.command_counter += 1
|
||||||
|
session.cmd_last = now
|
||||||
self.portal.amp_protocol.send_MsgPortal2Server(session,
|
self.portal.amp_protocol.send_MsgPortal2Server(session,
|
||||||
text=text,
|
text=text,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue