Reworked the flow of the data property through AMP to fix inconsistencies and make some overall cleanup of the arguments used to send AMP messages. Resolves #815.
This commit is contained in:
parent
6a11da1714
commit
1348fae5a0
3 changed files with 62 additions and 78 deletions
|
|
@ -113,7 +113,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
#print "connecting", session.sessid, " number:", len(self.sessions)
|
||||
self.portal.amp_protocol.send_AdminPortal2Server(session.sessid,
|
||||
operation=PCONN,
|
||||
data=sessdata)
|
||||
sessiondata=sessdata)
|
||||
|
||||
def sync(self, session):
|
||||
"""
|
||||
|
|
@ -142,7 +142,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
"server_data",))
|
||||
self.portal.amp_protocol.send_AdminPortal2Server(session.sessid,
|
||||
operation=PCONNSYNC,
|
||||
data=sessdata)
|
||||
sessiondata=sessdata)
|
||||
|
||||
def disconnect(self, session):
|
||||
"""
|
||||
|
|
@ -389,7 +389,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
# data throttle (anti DoS measure)
|
||||
now = time()
|
||||
dT = now - self.command_counter_reset
|
||||
print " command rate:", _MAX_COMMAND_RATE / dT, dT, self.command_counter
|
||||
#print " command rate:", _MAX_COMMAND_RATE / dT, dT, self.command_counter
|
||||
self.command_counter = 0
|
||||
self.command_counter_reset = now
|
||||
self.command_overflow = dT < 1.0
|
||||
|
|
@ -401,8 +401,8 @@ class PortalSessionHandler(SessionHandler):
|
|||
# relay data to Server
|
||||
self.command_counter += 1
|
||||
self.portal.amp_protocol.send_MsgPortal2Server(session.sessid,
|
||||
msg=text,
|
||||
data=kwargs)
|
||||
text=text,
|
||||
**kwargs)
|
||||
else:
|
||||
# called by the callLater callback
|
||||
if self.command_overflow:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue