Browse Source

faster RTT recalculation if bad sample

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

6
libi2pd/Streaming.cpp

@ -197,6 +197,12 @@ namespace stream
if (m_IsImmediateAckRequested) if (m_IsImmediateAckRequested)
{ {
auto ts = i2p::util::GetMillisecondsSinceEpoch (); 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_RTT = (m_RTT + (ts - m_LastSendTime)) / 2;
m_IsImmediateAckRequested = false; m_IsImmediateAckRequested = false;
} }

Loading…
Cancel
Save