Skip to content

Commit

Permalink
doen't send Ack packet too often if missing packets
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jan 27, 2024
1 parent 530c353 commit a3246cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libi2pd/Streaming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,11 @@ namespace stream
// save message and wait for missing message again
SavePacket (packet);
if (m_LastReceivedSequenceNumber >= 0)
// send NACKs for missing messages with minimal timeout
ScheduleAck (MIN_SEND_ACK_TIMEOUT);
{
if (!m_IsAckSendScheduled)
// send NACKs for missing messages
ScheduleAck (MIN_SEND_ACK_TIMEOUT*m_SavedPackets.size ());
}
else
// wait for SYN
ScheduleAck (SYN_TIMEOUT);
Expand Down

0 comments on commit a3246cd

Please sign in to comment.