From 6a743f66e89fa58d242ba5e2585cc7dd20d37b1e Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 4 Dec 2022 17:52:44 -0500 Subject: [PATCH] eliminate RTT self-reduction --- libi2pd/Streaming.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index 9ba236d7..5b4468fd 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -435,7 +435,7 @@ namespace stream LogPrint(eLogError, "Streaming: Packet ", seqn, "sent from the future, sendTime=", sentPacket->sendTime); rtt = 1; } - m_RTT = (m_RTT*seqn + rtt)/(seqn + 1); + m_RTT = std::round ((m_RTT*seqn + rtt)/(seqn + 1.0)); m_RTO = m_RTT*1.5; // TODO: implement it better LogPrint (eLogDebug, "Streaming: Packet ", seqn, " acknowledged rtt=", rtt, " sentTime=", sentPacket->sendTime); m_SentPackets.erase (it++);