From 0640bec026990b96c20c3c6371624b854c06e154 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 8 Jun 2022 12:52:56 -0400 Subject: [PATCH] corect ack count in ranges --- libi2pd/SSU2Session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd/SSU2Session.cpp b/libi2pd/SSU2Session.cpp index e1b472e1..66cc63f4 100644 --- a/libi2pd/SSU2Session.cpp +++ b/libi2pd/SSU2Session.cpp @@ -1101,7 +1101,7 @@ namespace transport if (*ranges > lastPacketNum) break; lastPacketNum -= *ranges; ranges++; // nacks if (*ranges > lastPacketNum) break; - firstPacketNum = lastPacketNum - *ranges; ranges++; // acks + firstPacketNum = lastPacketNum - *ranges + 1; ranges++; // acks len -= 2; HandleAckRange (firstPacketNum, lastPacketNum); } @@ -1112,7 +1112,7 @@ namespace transport if (firstPacketNum > lastPacketNum) return; auto it = m_SentPackets.begin (); while (it != m_SentPackets.end () && it->first < firstPacketNum) it++; // find first acked packet - if (it == m_SentPackets.end ()) return; // not found + 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--;