Commit f6815cd3 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

SSH: Count only non-closing channels in closeAllChannels().



Otherwise we might get false positives in the check in
SshConnectionManager.

Change-Id: Ia54be53ce294c75fbfad2e6475c9d489d2639504
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 28e7dcea
......@@ -177,9 +177,15 @@ void SshChannelManager::insertChannel(AbstractSshChannel *priv,
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();
int count = 0;
for (ChannelIterator it = m_channels.begin(); it != m_channels.end(); ++it) {
AbstractSshChannel * const channel = it.value();
QSSH_ASSERT(channel->channelState() != AbstractSshChannel::Closed);
if (channel->channelState() != AbstractSshChannel::CloseRequested) {
channel->closeChannel();
++count;
}
}
if (mode == CloseAllAndReset) {
m_channels.clear();
m_sessions.clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment