close relay socket if associate socket gets closed

This commit is contained in:
orignal 2022-10-28 18:54:04 -04:00
parent 1738d118f7
commit 4ed4e8708e

View file

@ -1288,6 +1288,7 @@ namespace transport
LogPrint(eLogWarning, "SSU2: Proxy UDP Associate socket error ", ecode.message()); LogPrint(eLogWarning, "SSU2: Proxy UDP Associate socket error ", ecode.message());
m_UDPAssociateSocket.reset (nullptr); m_UDPAssociateSocket.reset (nullptr);
m_ProxyRelayEndpoint.reset (nullptr); m_ProxyRelayEndpoint.reset (nullptr);
m_SocketV4.close ();
ConnectToProxy (); // try to reconnect immediately ConnectToProxy (); // try to reconnect immediately
} }
else else
@ -1310,6 +1311,7 @@ namespace transport
{ {
m_UDPAssociateSocket.reset (nullptr); m_UDPAssociateSocket.reset (nullptr);
m_ProxyRelayEndpoint.reset (nullptr); m_ProxyRelayEndpoint.reset (nullptr);
LogPrint(eLogInfo, "SSU2: Reconnecting to proxy");
ConnectToProxy (); ConnectToProxy ();
} }
}); });