forked from qt-creator/qt-creator
SSH: Count only non-closing channels in closeAllChannels().
Otherwise we might get false positives in the check in SshConnectionManager. Change-Id: Ia54be53ce294c75fbfad2e6475c9d489d2639504 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user