Skip to content
Snippets Groups Projects
Unverified Commit 1b5dc81a authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

master: Drop replaced connection right away

So we generate logout before the new login.
parent fc52332e
Branches
No related merge requests found
......@@ -95,6 +95,8 @@ class ClientConn(twisted.protocols.basic.Int32StringReceiver):
reactor.callLater(60, self.__check_logged)
def connectionLost(self, reason):
if not self.__connected:
return
self.__connected = False
if self.__logged_in:
logger.info("Connection lost from %s", self.cid())
......
......@@ -173,6 +173,7 @@ class Plugins:
logger.warn('Stray connection from %s, dropping old connection', client.cid())
elif client.session_id is not None and self.__clients[client.cid()].session_id == client.session_id:
logger.warn('Taking over previous connection from session %s on client %s', client.session_id, client.cid())
self.__clients[client.cid()].connectionLost(None)
else:
logger.warn("%s already connected, dropping connection", client.cid())
return False
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment