forked from qt-creator/qt-creator
SSH: Take more care when closing channels.
We can't just pretend a channel is already gone after we request it to close; it's only closed when the server has sent the acknowledgement. Change-Id: Ib6e8b9bf77635995259885af13755f5fc0e825a9 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -176,16 +176,23 @@ void SshChannelManager::insertChannel(AbstractSshChannel *priv,
|
||||
m_sessions.insert(priv, pub);
|
||||
}
|
||||
|
||||
int SshChannelManager::closeAllChannels()
|
||||
int SshChannelManager::closeAllChannels(CloseAllMode mode)
|
||||
{
|
||||
const int count = m_channels.count();
|
||||
for (ChannelIterator it = m_channels.begin(); it != m_channels.end(); ++it)
|
||||
it.value()->closeChannel();
|
||||
m_channels.clear();
|
||||
m_sessions.clear();
|
||||
if (mode == CloseAllAndReset) {
|
||||
m_channels.clear();
|
||||
m_sessions.clear();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int SshChannelManager::channelCount() const
|
||||
{
|
||||
return m_channels.count();
|
||||
}
|
||||
|
||||
void SshChannelManager::removeChannel(ChannelIterator it)
|
||||
{
|
||||
Q_ASSERT(it != m_channels.end() && "Unexpected channel lookup failure.");
|
||||
|
||||
Reference in New Issue
Block a user