mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
check for max number of NACKs
This commit is contained in:
parent
f75de6af82
commit
8a478e4616
1 changed files with 6 additions and 0 deletions
|
@ -378,6 +378,12 @@ namespace stream
|
||||||
for (auto it: m_SavedPackets)
|
for (auto it: m_SavedPackets)
|
||||||
{
|
{
|
||||||
auto seqn = it->GetSeqn ();
|
auto seqn = it->GetSeqn ();
|
||||||
|
if (numNacks + (seqn - nextSeqn) >= 256)
|
||||||
|
{
|
||||||
|
LogPrint (eLogError, "Number of NACKs exceeds 256");
|
||||||
|
htobe32buf (packet + 12, nextSeqn); // change ack Through
|
||||||
|
break;
|
||||||
|
}
|
||||||
for (uint32_t i = nextSeqn; i < seqn; i++)
|
for (uint32_t i = nextSeqn; i < seqn; i++)
|
||||||
{
|
{
|
||||||
htobe32buf (nacks, i);
|
htobe32buf (nacks, i);
|
||||||
|
|
Loading…
Add table
Reference in a new issue