Browse Source

faster RTT recalculation if bad sample

pull/2101/head
orignal 2 months ago
parent
commit
78ec5b2c6e
  1. 8
      libi2pd/Streaming.cpp

8
libi2pd/Streaming.cpp

@ -197,7 +197,13 @@ namespace stream @@ -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…
Cancel
Save