From 0e477bf9382000989636a6fb10425060363b060a Mon Sep 17 00:00:00 2001
From: orignal <i2porignal@yandex.ru>
Date: Wed, 26 Oct 2022 18:55:13 -0400
Subject: [PATCH] set min MTU if through proxy

---
 libi2pd/SSU2.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libi2pd/SSU2.cpp b/libi2pd/SSU2.cpp
index 7f6fbd42..4f3e8bf4 100644
--- a/libi2pd/SSU2.cpp
+++ b/libi2pd/SSU2.cpp
@@ -45,7 +45,8 @@ namespace transport
 					if (m_IsThroughProxy)
 					{
 						found = true;
-						break; // we don't need port for proxy
+						i2p::context.SetMTU (SSU2_MIN_PACKET_SIZE, address->IsV4 ());
+						continue; // we don't need port for proxy
 					}	
 					auto port = address->port;
 					if (!port)
@@ -90,9 +91,9 @@ namespace transport
 			}
 			if (found)
 			{	
-				m_ReceiveService.Start ();
 				if (m_IsThroughProxy)
 					ConnectToProxy ();
+				m_ReceiveService.Start ();
 			}	
 			ScheduleTermination ();
 			ScheduleResend (false);