mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-10 16:37:54 +00:00
detect congesion for first message in sned queue only
This commit is contained in:
parent
9a43f0d54c
commit
79087f6942
@ -560,13 +560,14 @@ namespace stream
|
|||||||
{
|
{
|
||||||
if (ecode != boost::asio::error::operation_aborted)
|
if (ecode != boost::asio::error::operation_aborted)
|
||||||
{
|
{
|
||||||
bool congesion = false;
|
bool congesion = false, first = true;
|
||||||
std::vector<Packet *> packets;
|
std::vector<Packet *> packets;
|
||||||
for (auto it : m_SentPackets)
|
for (auto it : m_SentPackets)
|
||||||
{
|
{
|
||||||
it->numResendAttempts++;
|
it->numResendAttempts++;
|
||||||
if (it->numResendAttempts == 1) // detect congesion at first attempt only
|
if (first && it->numResendAttempts == 1) // detect congesion at first attempt of first packet only
|
||||||
congesion = true;
|
congesion = true;
|
||||||
|
first = false;
|
||||||
if (it->numResendAttempts <= MAX_NUM_RESEND_ATTEMPTS)
|
if (it->numResendAttempts <= MAX_NUM_RESEND_ATTEMPTS)
|
||||||
packets.push_back (it);
|
packets.push_back (it);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user