Allow options to partially update portal session, correctly relay late handshakes.

This commit is contained in:
Griatch 2017-12-31 23:16:16 +01:00
parent 9355b255ad
commit c8b1dfcd20
5 changed files with 38 additions and 12 deletions

View file

@ -118,7 +118,13 @@ class Session(object):
"""
for propname, value in sessdata.items():
setattr(self, propname, value)
if (propname == "prototocol_flags" and isinstance(value, dict) and
hasattr(self, "protocol_flags") and
isinstance(self.protocol_flags.propname, dict)):
# special handling to allow partial update of protocol flags
self.protocol_flags.update(value)
else:
setattr(self, propname, value)
def at_sync(self):
"""