From 0c2b0081b5cc4ffbedd09bed70a7141f43ca6312 Mon Sep 17 00:00:00 2001
From: orignal <i2porignal@yandex.ru>
Date: Thu, 21 May 2020 19:38:25 -0400
Subject: [PATCH] rollback

---
 libi2pd/Streaming.cpp | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp
index 0af7d902..00ee35b0 100644
--- a/libi2pd/Streaming.cpp
+++ b/libi2pd/Streaming.cpp
@@ -408,14 +408,11 @@ namespace stream
 			else
 				break;
 		}
+		if (m_SentPackets.empty ())
+			m_ResendTimer.cancel ();
 		if (acknowledged)
 		{
-			bool isPreviousResend = m_NumResendAttempts > 0;
 			m_NumResendAttempts = 0;
-			if (m_SentPackets.empty ())
-				m_ResendTimer.cancel ();
-			else if (isPreviousResend) // resend outstanding
-				HandleResendTimer (boost::system::error_code ()); // no error
 			SendBuffer ();
 		}
 		if (m_Status == eStreamStatusClosed)
@@ -827,8 +824,6 @@ namespace stream
 			}
 
 			// collect packets to resend
-			int maxNumPackets = (m_WindowSize >> 1); // /2
-			if (maxNumPackets < WINDOW_SIZE) maxNumPackets = WINDOW_SIZE;
 			auto ts = i2p::util::GetMillisecondsSinceEpoch ();
 			std::vector<Packet *> packets;
 			for (auto it : m_SentPackets)
@@ -837,8 +832,6 @@ namespace stream
 				{
 					it->sendTime = ts;
 					packets.push_back (it);
-					maxNumPackets--;
-					if (maxNumPackets <= 0) break;
 				}
 			}