mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
faster RTT recalculation if bad sample
This commit is contained in:
parent
272bf7dbc1
commit
78ec5b2c6e
|
@ -197,7 +197,13 @@ namespace stream
|
|||
if (m_IsImmediateAckRequested)
|
||||
{
|
||||
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
||||
m_RTT = (m_RTT + (ts - m_LastSendTime)) / 2;
|
||||
if (m_IsFirstRttSample)
|
||||
{
|
||||
m_RTT = ts - m_LastSendTime;
|
||||
m_IsFirstRttSample = false;
|
||||
}
|
||||
else
|
||||
m_RTT = (m_RTT + (ts - m_LastSendTime)) / 2;
|
||||
m_IsImmediateAckRequested = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue