SSH: Introduce keep-alive mechanism.

Neither TCP nor the SSH protocol offer a built-in way to reliably
notice connection loss, so we implement our own.

Task-number: QTCREATORBUG-3783
This commit is contained in:
Christian Kandeler
2011-02-11 14:00:54 +01:00
parent 8ae0ad9442
commit 0d430277d4
9 changed files with 97 additions and 2 deletions

View File

@@ -257,7 +257,23 @@ SshDebug SshIncomingPacket::extractDebug() const
return msg;
} catch (SshPacketParseException &) {
throw SSH_SERVER_EXCEPTION(SSH_DISCONNECT_PROTOCOL_ERROR,
"Invalid SSH_MSG_USERAUTH_BANNER.");
"Invalid SSH_MSG_DEBUG.");
}
}
SshUnimplemented SshIncomingPacket::extractUnimplemented() const
{
Q_ASSERT(isComplete());
Q_ASSERT(type() == SSH_MSG_UNIMPLEMENTED);
try {
SshUnimplemented msg;
quint32 offset = TypeOffset + 1;
msg.invalidMsgSeqNr = SshPacketParser::asUint32(m_data, &offset);
return msg;
} catch (SshPacketParseException &) {
throw SSH_SERVER_EXCEPTION(SSH_DISCONNECT_PROTOCOL_ERROR,
"Invalid SSH_MSG_UNIMPLEMENTED.");
}
}