mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-07 07:44:13 +00:00
more routine cleanup
This commit is contained in:
parent
93d879b297
commit
fe744f8f81
@ -679,6 +679,22 @@ namespace transport
|
|||||||
it.second->CleanUp (ts);
|
it.second->CleanUp (ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto it = m_SessionsByRouterHash.begin (); it != m_SessionsByRouterHash.begin ();)
|
||||||
|
{
|
||||||
|
if (it->second && it->second->GetState () == eSSU2SessionStateTerminated)
|
||||||
|
it = m_SessionsByRouterHash.erase (it);
|
||||||
|
else
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto it = m_Relays.begin (); it != m_Relays.begin ();)
|
||||||
|
{
|
||||||
|
if (it->second && it->second->GetState () == eSSU2SessionStateTerminated)
|
||||||
|
it = m_Relays.erase (it);
|
||||||
|
else
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto it = m_IncomingTokens.begin (); it != m_IncomingTokens.end (); )
|
for (auto it = m_IncomingTokens.begin (); it != m_IncomingTokens.end (); )
|
||||||
{
|
{
|
||||||
if (ts > it->second.second)
|
if (ts > it->second.second)
|
||||||
@ -694,7 +710,8 @@ namespace transport
|
|||||||
else
|
else
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_PacketsPool.CleanUpMt ();
|
||||||
ScheduleTermination ();
|
ScheduleTermination ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ namespace transport
|
|||||||
boost::asio::ip::udp::socket m_SocketV4, m_SocketV6;
|
boost::asio::ip::udp::socket m_SocketV4, m_SocketV6;
|
||||||
boost::asio::ip::address m_AddressV4, m_AddressV6;
|
boost::asio::ip::address m_AddressV4, m_AddressV6;
|
||||||
std::unordered_map<uint64_t, std::shared_ptr<SSU2Session> > m_Sessions;
|
std::unordered_map<uint64_t, std::shared_ptr<SSU2Session> > m_Sessions;
|
||||||
std::map<i2p::data::IdentHash, std::shared_ptr<SSU2Session> > m_SessionsByRouterHash;
|
std::unordered_map<i2p::data::IdentHash, std::shared_ptr<SSU2Session> > m_SessionsByRouterHash;
|
||||||
std::map<boost::asio::ip::udp::endpoint, std::shared_ptr<SSU2Session> > m_PendingOutgoingSessions;
|
std::map<boost::asio::ip::udp::endpoint, std::shared_ptr<SSU2Session> > m_PendingOutgoingSessions;
|
||||||
std::map<boost::asio::ip::udp::endpoint, std::pair<uint64_t, uint32_t> > m_IncomingTokens, m_OutgoingTokens; // remote endpoint -> (token, expires in seconds)
|
std::map<boost::asio::ip::udp::endpoint, std::pair<uint64_t, uint32_t> > m_IncomingTokens, m_OutgoingTokens; // remote endpoint -> (token, expires in seconds)
|
||||||
std::map<uint32_t, std::shared_ptr<SSU2Session> > m_Relays; // we are introducer, relay tag -> session
|
std::map<uint32_t, std::shared_ptr<SSU2Session> > m_Relays; // we are introducer, relay tag -> session
|
||||||
|
Loading…
x
Reference in New Issue
Block a user