mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
remove tag after tagset expiration
This commit is contained in:
parent
b1262d54de
commit
aedcd1bcc0
|
@ -107,7 +107,7 @@ namespace garlic
|
||||||
|
|
||||||
bool ReceiveRatchetTagSet::IsIndexExpired (int index) const
|
bool ReceiveRatchetTagSet::IsIndexExpired (int index) const
|
||||||
{
|
{
|
||||||
return index < m_TrimBehindIndex || !m_Session || m_Session->IsTerminated ();
|
return index < m_TrimBehindIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReceiveRatchetTagSet::HandleNextMessage (uint8_t * buf, size_t len, int index)
|
bool ReceiveRatchetTagSet::HandleNextMessage (uint8_t * buf, size_t len, int index)
|
||||||
|
|
|
@ -876,7 +876,12 @@ namespace garlic
|
||||||
numExpiredTags++;
|
numExpiredTags++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
auto session = it->second.tagset->GetSession ();
|
||||||
|
if (!session || session->IsTerminated())
|
||||||
|
it->second.tagset->Expire ();
|
||||||
++it;
|
++it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (numExpiredTags > 0)
|
if (numExpiredTags > 0)
|
||||||
LogPrint (eLogDebug, "Garlic: ", numExpiredTags, " ECIESx25519 tags expired for ", GetIdentHash().ToBase64 ());
|
LogPrint (eLogDebug, "Garlic: ", numExpiredTags, " ECIESx25519 tags expired for ", GetIdentHash().ToBase64 ());
|
||||||
|
@ -1101,7 +1106,7 @@ namespace garlic
|
||||||
auto it = m_ECIESx25519Sessions.find (staticKey);
|
auto it = m_ECIESx25519Sessions.find (staticKey);
|
||||||
if (it != m_ECIESx25519Sessions.end ())
|
if (it != m_ECIESx25519Sessions.end ())
|
||||||
{
|
{
|
||||||
it->second->SetOwner (nullptr);
|
it->second->Terminate ();
|
||||||
m_ECIESx25519Sessions.erase (it);
|
m_ECIESx25519Sessions.erase (it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue