From 935e93eb36011e3e04413eee10fef5babe1e85fd Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 5 Dec 2021 17:54:34 -0500 Subject: [PATCH] minimal send ack interval --- libi2pd/Streaming.cpp | 1 + libi2pd/Streaming.h | 1 + 2 files changed, 2 insertions(+) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index b3c4230f..4967c93d 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -182,6 +182,7 @@ namespace stream m_IsAckSendScheduled = true; auto ackTimeout = m_RTT/10; if (ackTimeout > m_AckDelay) ackTimeout = m_AckDelay; + else if (ackTimeout < MIN_SEND_ACK_TIMEOUT) ackTimeout = MIN_SEND_ACK_TIMEOUT; m_AckSendTimer.expires_from_now (boost::posix_time::milliseconds(ackTimeout)); m_AckSendTimer.async_wait (std::bind (&Stream::HandleAckSendTimer, shared_from_this (), std::placeholders::_1)); diff --git a/libi2pd/Streaming.h b/libi2pd/Streaming.h index f2ed3002..088c2e11 100644 --- a/libi2pd/Streaming.h +++ b/libi2pd/Streaming.h @@ -58,6 +58,7 @@ namespace stream const int MAX_WINDOW_SIZE = 128; const int INITIAL_RTT = 8000; // in milliseconds const int INITIAL_RTO = 9000; // in milliseconds + const int MIN_SEND_ACK_TIMEOUT = 2; // in milliseconds const int SYN_TIMEOUT = 200; // how long we wait for SYN after follow-on, in milliseconds const size_t MAX_PENDING_INCOMING_BACKLOG = 128; const int PENDING_INCOMING_TIMEOUT = 10; // in seconds