1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-02-07 11:54:16 +00:00

cleanup tags on stop

This commit is contained in:
orignal 2016-11-28 22:47:37 -05:00
parent 3480824290
commit e726d216bb
3 changed files with 8 additions and 0 deletions

View File

@ -150,6 +150,7 @@ namespace client
delete m_Thread; delete m_Thread;
m_Thread = 0; m_Thread = 0;
} }
CleanUp (); // GarlicDestination
return true; return true;
} }
else else

View File

@ -394,6 +394,12 @@ namespace garlic
{ {
} }
void GarlicDestination::CleanUp ()
{
m_Sessions.clear ();
m_DeliveryStatusSessions.clear ();
m_Tags.clear ();
}
void GarlicDestination::AddSessionKey (const uint8_t * key, const uint8_t * tag) void GarlicDestination::AddSessionKey (const uint8_t * key, const uint8_t * tag)
{ {
if (key) if (key)

View File

@ -156,6 +156,7 @@ namespace garlic
GarlicDestination (): m_NumTags (32) {}; // 32 tags by default GarlicDestination (): m_NumTags (32) {}; // 32 tags by default
~GarlicDestination (); ~GarlicDestination ();
void CleanUp ();
void SetNumTags (int numTags) { m_NumTags = numTags; }; void SetNumTags (int numTags) { m_NumTags = numTags; };
std::shared_ptr<GarlicRoutingSession> GetRoutingSession (std::shared_ptr<const i2p::data::RoutingDestination> destination, bool attachLeaseSet); std::shared_ptr<GarlicRoutingSession> GetRoutingSession (std::shared_ptr<const i2p::data::RoutingDestination> destination, bool attachLeaseSet);
void CleanupExpiredTags (); void CleanupExpiredTags ();