mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-13 01:20:22 +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_DHKeysPairSupplier.Start ();
|
||||||
m_IsRunning = true;
|
m_IsRunning = true;
|
||||||
m_Thread = new std::thread (std::bind (&Transports::Run, this));
|
m_Thread = new std::thread (std::bind (&Transports::Run, this));
|
||||||
m_Timer = new boost::asio::deadline_timer (m_Service);
|
|
||||||
// create acceptors
|
// create acceptors
|
||||||
auto addresses = context.GetRouterInfo ().GetAddresses ();
|
auto addresses = context.GetRouterInfo ().GetAddresses ();
|
||||||
for (auto& address : addresses)
|
for (auto& address : addresses)
|
||||||
@ -128,12 +127,6 @@ namespace i2p
|
|||||||
delete session.second;
|
delete session.second;
|
||||||
m_NTCPSessions.clear ();
|
m_NTCPSessions.clear ();
|
||||||
delete m_NTCPAcceptor;
|
delete m_NTCPAcceptor;
|
||||||
|
|
||||||
if (m_Timer)
|
|
||||||
{
|
|
||||||
m_Timer->cancel ();
|
|
||||||
delete m_Timer;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_SSUServer)
|
if (m_SSUServer)
|
||||||
{
|
{
|
||||||
@ -272,22 +265,8 @@ namespace i2p
|
|||||||
if (router && router->IsSSU () && m_SSUServer)
|
if (router && router->IsSSU () && m_SSUServer)
|
||||||
m_SSUServer->GetSession (router, true); // peer test
|
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 ()
|
i2p::data::DHKeysPair * Transports::GetNextDHKeysPair ()
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,6 @@ namespace i2p
|
|||||||
void PostMessage (const i2p::data::IdentHash& ident, i2p::I2NPMessage * msg);
|
void PostMessage (const i2p::data::IdentHash& ident, i2p::I2NPMessage * msg);
|
||||||
|
|
||||||
void DetectExternalIP ();
|
void DetectExternalIP ();
|
||||||
void HandleTimer (const boost::system::error_code& ecode);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -83,7 +82,6 @@ namespace i2p
|
|||||||
|
|
||||||
std::map<i2p::data::IdentHash, i2p::ntcp::NTCPSession *> m_NTCPSessions;
|
std::map<i2p::data::IdentHash, i2p::ntcp::NTCPSession *> m_NTCPSessions;
|
||||||
i2p::ssu::SSUServer * m_SSUServer;
|
i2p::ssu::SSUServer * m_SSUServer;
|
||||||
boost::asio::deadline_timer * m_Timer;
|
|
||||||
|
|
||||||
DHKeysPairSupplier m_DHKeysPairSupplier;
|
DHKeysPairSupplier m_DHKeysPairSupplier;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user