faster RTT recalculation if bad sample

This commit is contained in:
orignal 2024-09-11 11:24:51 -04:00
parent 272bf7dbc1
commit 78ec5b2c6e

View File

@ -197,6 +197,12 @@ namespace stream
if (m_IsImmediateAckRequested)
{
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
if (m_IsFirstRttSample)
{
m_RTT = ts - m_LastSendTime;
m_IsFirstRttSample = false;
}
else
m_RTT = (m_RTT + (ts - m_LastSendTime)) / 2;
m_IsImmediateAckRequested = false;
}