mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
don't delete initial SSU sessions
This commit is contained in:
parent
03a5059617
commit
3c6793745b
@ -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 ()
|
||||
{
|
||||
|
@ -71,7 +71,6 @@ namespace i2p
|
||||
void PostMessage (const i2p::data::IdentHash& ident, i2p::I2NPMessage * msg);
|
||||
|
||||
void DetectExternalIP ();
|
||||
void HandleTimer (const boost::system::error_code& ecode);
|
||||
|
||||
private:
|
||||
|
||||
@ -83,7 +82,6 @@ namespace i2p
|
||||
|
||||
std::map<i2p::data::IdentHash, i2p::ntcp::NTCPSession *> m_NTCPSessions;
|
||||
i2p::ssu::SSUServer * m_SSUServer;
|
||||
boost::asio::deadline_timer * m_Timer;
|
||||
|
||||
DHKeysPairSupplier m_DHKeysPairSupplier;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user