mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
TunnelPool added
This commit is contained in:
parent
70df239d14
commit
7caa46b381
5 changed files with 72 additions and 3 deletions
|
@ -14,7 +14,7 @@ namespace i2p
|
|||
namespace tunnel
|
||||
{
|
||||
|
||||
Tunnel::Tunnel (TunnelConfig * config): m_Config (config), m_IsEstablished (false)
|
||||
Tunnel::Tunnel (TunnelConfig * config): m_Config (config), m_Pool (nullptr), m_IsEstablished (false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -343,6 +343,9 @@ namespace tunnel
|
|||
for (auto& it : m_PendingTunnels)
|
||||
{
|
||||
LogPrint ("Pending tunnel build request ", it.first, " has not been responded. Deleted");
|
||||
auto pool = it.second->GetTunnelPool ();
|
||||
if (pool)
|
||||
pool->TunnelCreationFailed (it.second);
|
||||
delete it.second;
|
||||
}
|
||||
m_PendingTunnels.clear ();
|
||||
|
@ -418,6 +421,9 @@ namespace tunnel
|
|||
if (ts > it->second->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT)
|
||||
{
|
||||
LogPrint ("Tunnel ", it->second->GetTunnelID (), " expired");
|
||||
auto pool = it->second->GetTunnelPool ();
|
||||
if (pool)
|
||||
pool->TunnelExpired (it->second);
|
||||
it = m_InboundTunnels.erase (it);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue