diff --git a/src/master/client.py b/src/master/client.py index cfb496a12434a6dd99d31b352b255729b40f9d36..8ab432d1ea1ebfc410ed239cf533c308916a9422 100644 --- a/src/master/client.py +++ b/src/master/client.py @@ -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()) diff --git a/src/master/plugin.py b/src/master/plugin.py index ec10f627c0fda8ec92a86f9c57d15f55eb5caf3d..8a988f8f41505f31da9b98dc1c35549e8cc3b483 100644 --- a/src/master/plugin.py +++ b/src/master/plugin.py @@ -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