From c3dd7ed73aaf312fe4e635a3aa1ec726d8137e39 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 12 Aug 2022 18:56:58 -0400 Subject: [PATCH] try to resend if window is full --- libi2pd/SSU2Session.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libi2pd/SSU2Session.cpp b/libi2pd/SSU2Session.cpp index cfb530d1..56d87049 100644 --- a/libi2pd/SSU2Session.cpp +++ b/libi2pd/SSU2Session.cpp @@ -284,13 +284,18 @@ namespace transport for (auto it: msgs) m_SendQueue.push_back (it); SendQueue (); - - if (m_SendQueue.size () > SSU2_MAX_OUTGOING_QUEUE_SIZE) - { - LogPrint (eLogWarning, "SSU2: Outgoing messages queue size to ", - GetIdentHashBase64(), " exceeds ", SSU2_MAX_OUTGOING_QUEUE_SIZE); - RequestTermination (eSSU2TerminationReasonTimeout); - } + + if (m_SendQueue.size () > 0) // windows is full + { + if (m_SendQueue.size () <= SSU2_MAX_OUTGOING_QUEUE_SIZE) + Resend (i2p::util::GetMillisecondsSinceEpoch ()); + else + { + LogPrint (eLogWarning, "SSU2: Outgoing messages queue size to ", + GetIdentHashBase64(), " exceeds ", SSU2_MAX_OUTGOING_QUEUE_SIZE); + RequestTermination (eSSU2TerminationReasonTimeout); + } + } } bool SSU2Session::SendQueue () @@ -462,7 +467,6 @@ namespace transport m_WindowSize >>= 1; // /2 if (m_WindowSize < SSU2_MIN_WINDOW_SIZE) m_WindowSize = SSU2_MIN_WINDOW_SIZE; } - SendQueue (); } void SSU2Session::ResendHandshakePacket ()