mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-09 11:27:53 +00:00
correct hangling of Ack ranges
This commit is contained in:
parent
e8c58270c4
commit
079f7e515c
@ -1130,7 +1130,7 @@ namespace transport
|
|||||||
uint32_t lastPacketNum = firstPacketNum - 1;
|
uint32_t lastPacketNum = firstPacketNum - 1;
|
||||||
if (*ranges > lastPacketNum) break;
|
if (*ranges > lastPacketNum) break;
|
||||||
lastPacketNum -= *ranges; ranges++; // nacks
|
lastPacketNum -= *ranges; ranges++; // nacks
|
||||||
if (*ranges > lastPacketNum) break;
|
if (*ranges > lastPacketNum + 1) break;
|
||||||
firstPacketNum = lastPacketNum - *ranges + 1; ranges++; // acks
|
firstPacketNum = lastPacketNum - *ranges + 1; ranges++; // acks
|
||||||
len -= 2;
|
len -= 2;
|
||||||
HandleAckRange (firstPacketNum, lastPacketNum);
|
HandleAckRange (firstPacketNum, lastPacketNum);
|
||||||
@ -1145,7 +1145,6 @@ namespace transport
|
|||||||
if (it == m_SentPackets.end () || it->first > lastPacketNum) return; // not found
|
if (it == m_SentPackets.end () || it->first > lastPacketNum) return; // not found
|
||||||
auto it1 = it;
|
auto it1 = it;
|
||||||
while (it1 != m_SentPackets.end () && it1->first <= lastPacketNum) it1++;
|
while (it1 != m_SentPackets.end () && it1->first <= lastPacketNum) it1++;
|
||||||
if (it1 != m_SentPackets.end () && it1 != m_SentPackets.begin ()) it1--;
|
|
||||||
m_SentPackets.erase (it, it1);
|
m_SentPackets.erase (it, it1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user