From 079f7e515c1d30edf281b371a7c4b495fe6fda4b Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 16 Jun 2022 14:13:28 -0400 Subject: [PATCH] correct hangling of Ack ranges --- libi2pd/SSU2Session.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libi2pd/SSU2Session.cpp b/libi2pd/SSU2Session.cpp index fba150d3..175ece2a 100644 --- a/libi2pd/SSU2Session.cpp +++ b/libi2pd/SSU2Session.cpp @@ -1130,7 +1130,7 @@ namespace transport uint32_t lastPacketNum = firstPacketNum - 1; if (*ranges > lastPacketNum) break; lastPacketNum -= *ranges; ranges++; // nacks - if (*ranges > lastPacketNum) break; + if (*ranges > lastPacketNum + 1) break; firstPacketNum = lastPacketNum - *ranges + 1; ranges++; // acks len -= 2; HandleAckRange (firstPacketNum, lastPacketNum); @@ -1145,7 +1145,6 @@ namespace transport if (it == m_SentPackets.end () || it->first > lastPacketNum) return; // not found auto it1 = it; while (it1 != m_SentPackets.end () && it1->first <= lastPacketNum) it1++; - if (it1 != m_SentPackets.end () && it1 != m_SentPackets.begin ()) it1--; m_SentPackets.erase (it, it1); }