cleanup out-of-sequnce list more aggressivly

This commit is contained in:
orignal 2023-02-01 19:05:04 -05:00
parent 4960587f46
commit e9f0ed6473

View File

@ -2852,8 +2852,9 @@ namespace transport
if (!m_OutOfSequencePackets.empty ())
{
int ranges = 0;
while (m_OutOfSequencePackets.size () > 2*SSU2_MAX_NUM_ACK_RANGES ||
*m_OutOfSequencePackets.rbegin () > m_ReceivePacketNum + 255*8)
while (ranges < SSU2_MAX_NUM_ACK_RANGES && !m_OutOfSequencePackets.empty () &&
(m_OutOfSequencePackets.size () > 2*SSU2_MAX_NUM_ACK_RANGES ||
*m_OutOfSequencePackets.rbegin () > m_ReceivePacketNum + 255*8))
{
uint32_t packet = *m_OutOfSequencePackets.begin ();
if (packet > m_ReceivePacketNum + 1)
@ -2863,7 +2864,6 @@ namespace transport
m_ReceivePacketNum = packet - 1;
UpdateReceivePacketNum (packet);
ranges++;
if (ranges > SSU2_MAX_NUM_ACK_RANGES) break;
}
else
{