Catch cases where Sessions have already been removed on either side of the AMP connection. This may remove the annoying Portal errors on the form 'AMP Error for AdminPortal2Server: 1'. Probably unrelated to #1128, but linking to it anyway.
This commit is contained in:
parent
cdaa137868
commit
203d0a09a0
1 changed files with 10 additions and 7 deletions
|
|
@ -512,9 +512,10 @@ class AMPProtocol(amp.AMP):
|
||||||
server_sessionhandler.portal_session_sync(kwargs.get("sessiondata"))
|
server_sessionhandler.portal_session_sync(kwargs.get("sessiondata"))
|
||||||
|
|
||||||
elif operation == PDISCONN: # portal_session_disconnect
|
elif operation == PDISCONN: # portal_session_disconnect
|
||||||
# session closed from portal side
|
# session closed from portal sid
|
||||||
session = server_sessionhandler[sessid]
|
session = server_sessionhandler.get(sessid)
|
||||||
server_sessionhandler.portal_disconnect(session)
|
if session:
|
||||||
|
server_sessionhandler.portal_disconnect(session)
|
||||||
|
|
||||||
elif operation == PDISCONNALL: # portal_disconnect_all
|
elif operation == PDISCONNALL: # portal_disconnect_all
|
||||||
# portal orders all sessions to close
|
# portal orders all sessions to close
|
||||||
|
|
@ -566,13 +567,15 @@ class AMPProtocol(amp.AMP):
|
||||||
|
|
||||||
if operation == SLOGIN: # server_session_login
|
if operation == SLOGIN: # server_session_login
|
||||||
# a session has authenticated; sync it.
|
# a session has authenticated; sync it.
|
||||||
session = portal_sessionhandler[sessid]
|
session = portal_sessionhandler.get(sessid)
|
||||||
portal_sessionhandler.server_logged_in(session, kwargs.get("sessiondata"))
|
if session:
|
||||||
|
portal_sessionhandler.server_logged_in(session, kwargs.get("sessiondata"))
|
||||||
|
|
||||||
elif operation == SDISCONN: # server_session_disconnect
|
elif operation == SDISCONN: # server_session_disconnect
|
||||||
# the server is ordering to disconnect the session
|
# the server is ordering to disconnect the session
|
||||||
session = portal_sessionhandler[sessid]
|
session = portal_sessionhandler.get(sessid)
|
||||||
portal_sessionhandler.server_disconnect(session, reason=kwargs.get("reason"))
|
if session:
|
||||||
|
portal_sessionhandler.server_disconnect(session, reason=kwargs.get("reason"))
|
||||||
|
|
||||||
elif operation == SDISCONNALL: # server_session_disconnect_all
|
elif operation == SDISCONNALL: # server_session_disconnect_all
|
||||||
# server orders all sessions to disconnect
|
# server orders all sessions to disconnect
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue