check for bogus times in packets

This commit is contained in:
Jeff Becker 2016-07-28 09:50:19 -04:00
parent f5684eba90
commit 50b9eca34c
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B

View File

@ -268,7 +268,12 @@ namespace stream
}
}
auto sentPacket = *it;
uint64_t rtt = ts - sentPacket->sendTime;
uint64_t rtt = ts - sentPacket->sendTime;
if(ts < sentPacket->sendTime)
{
LogPrint(eLogError, "Streaming: Packet ", seqn, "sent from the future, sendTime=", sentPacket->sendTime);
rtt = 0;
}
m_RTT = (m_RTT*seqn + rtt)/(seqn + 1);
m_RTO = m_RTT*1.5; // TODO: implement it better
LogPrint (eLogDebug, "Streaming: Packet ", seqn, " acknowledged rtt=", rtt);