close connection to first hop of declined tunnel

This commit is contained in:
orignal 2014-07-18 20:32:45 -04:00
parent 05d869254d
commit 8801a144a0
4 changed files with 25 additions and 3 deletions

View file

@ -263,6 +263,23 @@ namespace i2p
}
}
void Transports::CloseSession (const i2p::data::RouterInfo * router)
{
if (!router) return;
m_Service.post (boost::bind (&Transports::PostCloseSession, this, router));
}
void Transports::PostCloseSession (const i2p::data::RouterInfo * router)
{
auto ssuSession = m_SSUServer ? m_SSUServer->FindSession (router) : nullptr;
if (ssuSession) // try SSU first
{
m_SSUServer->DeleteSession (ssuSession);
LogPrint ("SSU session closed");
}
// TODO: delete NTCP
}
void Transports::DetectExternalIP ()
{
for (int i = 0; i < 5; i ++)