Skip to content

Commit 63685d6

Browse files
util/ssh: stop keepalive in disconnect() when existing connection is used
SSHConnection does not open a new connection if an existing connection is open. It reuses the connection and starts a keepalive command (cat). On disconnect(), the keepalive command is only stopped for newly initiated connections, not for existing ones. Fix that by stopping the keepalive first, unconditionally. Signed-off-by: Bastian Krause <bst@pengutronix.de>
1 parent 4fd7caf commit 63685d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

labgrid/util/ssh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,10 @@ def _stop_keepalive(self):
521521
def disconnect(self):
522522
assert self._connected
523523
try:
524+
self._stop_keepalive()
525+
524526
if self._socket:
525527
self._logger.info("Closing SSH connection to %s", self.host)
526-
self._stop_keepalive()
527528
self._stop_own_master()
528529
finally:
529530
self._connected = False

0 commit comments

Comments
 (0)