diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2012-06-20 15:55:30 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2012-06-28 11:55:37 +0200 |
commit | c1a89d2c6187aaae5ce607e9e6ac5b57c5aa1f2f (patch) | |
tree | d6d4cb4211931ed4354e09ed5a9ffe76b9b2456c /src/libs/ssh/sshconnection.h | |
parent | 621e5c3dbefef6d90ce02229aeff2da16309d541 (diff) |
SSH: Close channels before re-using a connection.
Otherwise a new client acquiring the connection could be affected by
things happening in channels that were not opened by that client, which
would certainly be unexpected.
In particular, if the new owner of the connection runs in a different
thread than the old one, crashes could occur since the connection
assumes its channels run in the same thread.
Change-Id: I4fdf2b5a3751ed506631d6878e94342da033c31c
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'src/libs/ssh/sshconnection.h')
-rw-r--r-- | src/libs/ssh/sshconnection.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h index 5354ec5946..5f70c282f5 100644 --- a/src/libs/ssh/sshconnection.h +++ b/src/libs/ssh/sshconnection.h @@ -106,6 +106,9 @@ public: QSharedPointer<SshRemoteProcess> createRemoteShell(); QSharedPointer<SftpChannel> createSftpChannel(); + // -1 if an error occurred, number of channels closed otherwise. + int closeAllChannels(); + signals: void connected(); void disconnected(); |