don't detach ECIESx25519 session from destination

This commit is contained in:
orignal 2021-01-05 15:56:48 -05:00
parent bc4a97774f
commit b1262d54de
6 changed files with 29 additions and 14 deletions

View file

@ -445,9 +445,16 @@ namespace garlic
void GarlicDestination::CleanUp ()
{
for (auto it: m_Sessions)
it.second->SetOwner (nullptr);
m_Sessions.clear ();
m_DeliveryStatusSessions.clear ();
m_Tags.clear ();
for (auto it: m_ECIESx25519Sessions)
{
it.second->Terminate ();
it.second->SetOwner (nullptr);
}
m_ECIESx25519Sessions.clear ();
m_ECIESx25519Tags.clear ();
}
@ -852,7 +859,7 @@ namespace garlic
{
if (it->second->CheckExpired (ts))
{
it->second->SetOwner (nullptr);
it->second->Terminate ();
it = m_ECIESx25519Sessions.erase (it);
}
else
@ -1077,7 +1084,7 @@ namespace garlic
{
if (it->second->CanBeRestarted (i2p::util::GetSecondsSinceEpoch ()))
{
it->second->SetOwner (nullptr); // detach
it->second->Terminate (); // detach
m_ECIESx25519Sessions.erase (it);
}
else