From ead1b72886b01a418828c1774987ae5213cf80d0 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 3 Sep 2024 15:20:33 -0400 Subject: [PATCH] set half of window on remote lease change --- libi2pd/Streaming.cpp | 2 +- libi2pd/Streaming.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index 1974cd10..881818d5 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -1439,7 +1439,7 @@ namespace stream m_RTO = INITIAL_RTO; if (m_WindowSize > INITIAL_WINDOW_SIZE) { - m_WindowDropTargetSize = INITIAL_WINDOW_SIZE; + m_WindowDropTargetSize = std::max (m_WindowSize/2, (float)INITIAL_WINDOW_SIZE); m_IsWinDropped = true; } else diff --git a/libi2pd/Streaming.h b/libi2pd/Streaming.h index c0b73162..84b92c9f 100644 --- a/libi2pd/Streaming.h +++ b/libi2pd/Streaming.h @@ -58,7 +58,7 @@ namespace stream const int MAX_WINDOW_SIZE = 1024; const double RTT_EWMA_ALPHA = 0.25; const double SLOWRTT_EWMA_ALPHA = 0.125; - const double PREV_SPEED_KEEP_TIME_COEFF = 0.1; // 0.1 - 1 // how long will the window size stay around the previous drop level, less is longer + const double PREV_SPEED_KEEP_TIME_COEFF = 0.35; // 0.1 - 1 // how long will the window size stay around the previous drop level, less is longer const int MIN_RTO = 20; // in milliseconds const int INITIAL_RTT = 8000; // in milliseconds const int INITIAL_RTO = 9000; // in milliseconds