mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-24 22:44:15 +00: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)
|
if (m_IsImmediateAckRequested)
|
||||||
{
|
{
|
||||||
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
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;
|
m_IsImmediateAckRequested = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user