Fixes a side effect of the #583 solution only showing up in certain connection timing combinations related to which protocols were supported in a given client. The portal<->server handhshake exchanged the session info an extra round depending on the internal timing of the connection. Also fixed a handshake bug in the MXP initialization.

This commit is contained in:
Griatch 2014-10-20 22:14:58 +02:00
parent a5b4ddd1e9
commit 3eb347a076
4 changed files with 6 additions and 4 deletions

View file

@ -51,6 +51,7 @@ class Mxp(object):
Client does not support MXP.
"""
self.protocol.protocol_flags["MXP"] = False
self.protocol.handshake_done()
def do_mxp(self, option):
"""

View file

@ -64,10 +64,11 @@ class PortalSessionHandler(SessionHandler):
# only use if session already has sessid (i.e. has already connected)
sessdata = session.get_sync_data()
if self.portal.amp_protocol:
# we remove sessdata that could already have changed on the
# server level
# we only send sessdata that should not have changed
# at the server level at this point
sessdata = dict((key, val) for key, val in sessdata.items() if key in ("protocol_key",
"address",
"sessid",
"suid",
"conn_time",
"protocol_flags",

View file

@ -95,7 +95,7 @@ class Session(object):
and loads it into the correct properties of the session.
"""
for propname, value in sessdata.items():
self.__dict__[propname] = value
setattr(self, propname, value)
def at_sync(self):
"""

View file

@ -344,7 +344,7 @@ class ServerSessionHandler(SessionHandler):
session.logged_in = True
# sync the portal to the session
sessdata = session.get_sync_data()
sessdata = {"logged_in": True}
if not testmode:
self.server.amp_protocol.call_remote_PortalAdmin(session.sessid,
operation=SLOGIN,