mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
send correct acnt if gaps
This commit is contained in:
parent
3052dbd1e8
commit
207b13dcab
1 changed files with 18 additions and 1 deletions
|
@ -992,7 +992,19 @@ namespace transport
|
||||||
htobe32buf (buf + 3, ackThrough); // Ack Through
|
htobe32buf (buf + 3, ackThrough); // Ack Through
|
||||||
uint8_t acnt = 0;
|
uint8_t acnt = 0;
|
||||||
if (ackThrough)
|
if (ackThrough)
|
||||||
acnt = std::min ((int)ackThrough, 255);
|
{
|
||||||
|
if (m_OutOfSequencePackets.empty ())
|
||||||
|
acnt = std::min ((int)ackThrough, 255); // no gaps
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto it = m_OutOfSequencePackets.rbegin (); it++; // prev packet num
|
||||||
|
while (it != m_OutOfSequencePackets.rend () && *it == ackThrough - acnt - 1)
|
||||||
|
{
|
||||||
|
acnt++;
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
buf[7] = acnt; // acnt
|
buf[7] = acnt; // acnt
|
||||||
// TODO: ranges
|
// TODO: ranges
|
||||||
return 8;
|
return 8;
|
||||||
|
@ -1106,6 +1118,11 @@ namespace transport
|
||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
if (m_OutOfSequencePackets.size () > 255)
|
||||||
|
{
|
||||||
|
m_ReceivePacketNum = *m_OutOfSequencePackets.rbegin ();
|
||||||
|
m_OutOfSequencePackets.clear ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SSU2Server::SSU2Server ():
|
SSU2Server::SSU2Server ():
|
||||||
|
|
Loading…
Add table
Reference in a new issue