|
|
@ -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 () |
|
|
|
{ |
|
|
|
{ |
|
|
|