mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
1 byte off for ranges in Ack block
This commit is contained in:
parent
03518ec94f
commit
0c64f278d7
@ -1638,7 +1638,7 @@ namespace transport
|
|||||||
{
|
{
|
||||||
if (lastNum - (*it) < 255)
|
if (lastNum - (*it) < 255)
|
||||||
{
|
{
|
||||||
buf[7 + numRanges*2] = lastNum - (*it) - 1; // NACKs
|
buf[8 + numRanges*2] = lastNum - (*it) - 1; // NACKs
|
||||||
lastNum = *it; it++;
|
lastNum = *it; it++;
|
||||||
uint8_t numAcks = 1;
|
uint8_t numAcks = 1;
|
||||||
while (it != m_OutOfSequencePackets.rend () && numAcks < 255 && lastNum > 0 && *it == lastNum - 1)
|
while (it != m_OutOfSequencePackets.rend () && numAcks < 255 && lastNum > 0 && *it == lastNum - 1)
|
||||||
@ -1646,7 +1646,7 @@ namespace transport
|
|||||||
numAcks++; lastNum--;
|
numAcks++; lastNum--;
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
buf[7 + numRanges*2 + 1] = numAcks; // Acks
|
buf[8 + numRanges*2 + 1] = numAcks; // Acks
|
||||||
numRanges++;
|
numRanges++;
|
||||||
if (numAcks == 255) break;
|
if (numAcks == 255) break;
|
||||||
}
|
}
|
||||||
@ -1660,8 +1660,8 @@ namespace transport
|
|||||||
if (nacks > 0)
|
if (nacks > 0)
|
||||||
{
|
{
|
||||||
if (nacks > 255) nacks = 255;
|
if (nacks > 255) nacks = 255;
|
||||||
buf[7 + numRanges*2] = nacks;
|
buf[8 + numRanges*2] = nacks;
|
||||||
buf[7 + numRanges*2 + 1] = std::min ((int)m_ReceivePacketNum, 255);
|
buf[8 + numRanges*2 + 1] = std::min ((int)m_ReceivePacketNum + 1, 255);
|
||||||
numRanges++;
|
numRanges++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user