mirror of
https://github.com/jpillora/chisel
synced 2026-06-08 15:07:02 +00:00
a3be26f9c5
When keep-alive is enabled, Client.loop() creates a go-routine to provide the functionality, however, the go-routine never exits, not even when the client's SSH connection to the server has been torn down, thus leaking the go-routine. This typically isn't a problem for the command-line chisel client since it is single-use; the SSH connection is torn down only when the client is terminating anyway. However, such a go-routine leak could become problematic if the client ever learns to manage multiple SSH connections (perhaps, say, via an interactive mode) or when chisel is used as a library by some other program which manages multiple connections. Therefore, ensure that the go-routine terminates when the SSH connection is torn down.