mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
resend not more than half of window
This commit is contained in:
parent
9318388007
commit
e5901dad91
@ -824,6 +824,8 @@ namespace stream
|
|||||||
}
|
}
|
||||||
|
|
||||||
// collect packets to resend
|
// collect packets to resend
|
||||||
|
int maxNumPackets = (m_WindowSize >> 1); // /2
|
||||||
|
if (maxNumPackets < WINDOW_SIZE) maxNumPackets = WINDOW_SIZE;
|
||||||
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
||||||
std::vector<Packet *> packets;
|
std::vector<Packet *> packets;
|
||||||
for (auto it : m_SentPackets)
|
for (auto it : m_SentPackets)
|
||||||
@ -832,6 +834,8 @@ namespace stream
|
|||||||
{
|
{
|
||||||
it->sendTime = ts;
|
it->sendTime = ts;
|
||||||
packets.push_back (it);
|
packets.push_back (it);
|
||||||
|
maxNumPackets--;
|
||||||
|
if (maxNumPackets <= 0) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -843,7 +847,7 @@ namespace stream
|
|||||||
switch (m_NumResendAttempts)
|
switch (m_NumResendAttempts)
|
||||||
{
|
{
|
||||||
case 1: // congesion avoidance
|
case 1: // congesion avoidance
|
||||||
m_WindowSize /= 2;
|
m_WindowSize >>= 1; // /2
|
||||||
if (m_WindowSize < MIN_WINDOW_SIZE) m_WindowSize = MIN_WINDOW_SIZE;
|
if (m_WindowSize < MIN_WINDOW_SIZE) m_WindowSize = MIN_WINDOW_SIZE;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user