1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 20:44:39 +00:00

clean up first out of sequence packet if too many

This commit is contained in:
orignal 2022-07-01 10:52:10 -04:00
parent d375299fa9
commit 455390f121

View File

@ -2126,6 +2126,19 @@ namespace transport
m_ReceivePacketNum = *m_OutOfSequencePackets.rbegin ();
m_OutOfSequencePackets.clear ();
}
else if (m_OutOfSequencePackets.size () > SSU2_MAX_NUM_ACK_RANGES)
{
uint32_t packet = *m_OutOfSequencePackets.begin ();
if (packet > m_ReceivePacketNum + 1)
{
// like we've just received all packets before first
m_ReceivePacketNum = packet - 1;
UpdateReceivePacketNum (packet);
}
else
LogPrint (eLogError, "SSU2: Out of sequence packet ", packet, " is less than last received", m_ReceivePacketNum);
}
for (auto it = m_RelaySessions.begin (); it != m_RelaySessions.end ();)
{
if (ts > it->second.second + SSU2_RELAY_NONCE_EXPIRATION_TIMEOUT)