SSH: Fix wrongly emitted assert.

Change-Id: Ib19030ccbf708a7ad738df89f3fc0a45b0052bb9
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-06-18 17:03:28 +02:00
parent 2c5b4b9be3
commit 88ab0ccbb6

View File

@@ -262,12 +262,13 @@ void AbstractSshChannel::closeChannel()
if (m_state == Inactive) { if (m_state == Inactive) {
setChannelState(Closed); setChannelState(Closed);
} else { } else {
const ChannelState oldState = m_state;
setChannelState(CloseRequested); setChannelState(CloseRequested);
if (m_remoteChannel != NoChannel) { if (m_remoteChannel != NoChannel) {
m_sendFacility.sendChannelEofPacket(m_remoteChannel); m_sendFacility.sendChannelEofPacket(m_remoteChannel);
m_sendFacility.sendChannelClosePacket(m_remoteChannel); m_sendFacility.sendChannelClosePacket(m_remoteChannel);
} else { } else {
QSSH_ASSERT(m_state == SessionRequested); QSSH_ASSERT(oldState == SessionRequested);
} }
} }
} }