Add handshake session timeout protection

This commit is contained in:
savis
2025-12-28 05:03:47 +01:00
parent c34a721328
commit e4182a1b9e
3 changed files with 28 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ void DESC::Initialize()
m_iHandshakeRetry = 0;
m_dwClientTime = 0;
m_bHandshaking = false;
m_handshake_time = get_dword_time();
m_lpBufferedOutputBuffer = NULL;
m_lpOutputBuffer = NULL;
@@ -715,6 +716,14 @@ bool DESC::IsHandshaking()
return m_bHandshaking;
}
bool DESC::IsExpiredHandshake() const
{
if (m_handshake_time == 0)
return false;
return (m_handshake_time + (5 * 1000)) < get_dword_time();
}
DWORD DESC::GetClientTime()
{
return m_dwClientTime;