mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
don't delete initial SSU sessions
This commit is contained in:
@@ -92,7 +92,6 @@ namespace i2p
|
||||
m_DHKeysPairSupplier.Start ();
|
||||
m_IsRunning = true;
|
||||
m_Thread = new std::thread (std::bind (&Transports::Run, this));
|
||||
m_Timer = new boost::asio::deadline_timer (m_Service);
|
||||
// create acceptors
|
||||
auto addresses = context.GetRouterInfo ().GetAddresses ();
|
||||
for (auto& address : addresses)
|
||||
@@ -128,12 +127,6 @@ namespace i2p
|
||||
delete session.second;
|
||||
m_NTCPSessions.clear ();
|
||||
delete m_NTCPAcceptor;
|
||||
|
||||
if (m_Timer)
|
||||
{
|
||||
m_Timer->cancel ();
|
||||
delete m_Timer;
|
||||
}
|
||||
|
||||
if (m_SSUServer)
|
||||
{
|
||||
@@ -272,22 +265,8 @@ namespace i2p
|
||||
if (router && router->IsSSU () && m_SSUServer)
|
||||
m_SSUServer->GetSession (router, true); // peer test
|
||||
}
|
||||
if (m_Timer)
|
||||
{
|
||||
m_Timer->expires_from_now (boost::posix_time::seconds(5)); // 5 seconds
|
||||
m_Timer->async_wait (boost::bind (&Transports::HandleTimer, this, boost::asio::placeholders::error));
|
||||
}
|
||||
}
|
||||
|
||||
void Transports::HandleTimer (const boost::system::error_code& ecode)
|
||||
{
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
{
|
||||
// end of external IP detection
|
||||
if (m_SSUServer)
|
||||
m_SSUServer->DeleteAllSessions ();
|
||||
}
|
||||
}
|
||||
|
||||
i2p::data::DHKeysPair * Transports::GetNextDHKeysPair ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user