Browse Source

cleanup out-of-sequnce list more aggressivly

pull/1867/head
orignal 2 years ago
parent
commit
e9f0ed6473
  1. 6
      libi2pd/SSU2Session.cpp

6
libi2pd/SSU2Session.cpp

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

Loading…
Cancel
Save