|
|
@ -190,7 +190,7 @@ namespace tunnel |
|
|
|
m_PendingTunnels.clear (); |
|
|
|
m_PendingTunnels.clear (); |
|
|
|
|
|
|
|
|
|
|
|
for (auto& it: m_Pools) |
|
|
|
for (auto& it: m_Pools) |
|
|
|
delete it; |
|
|
|
delete it.second; |
|
|
|
m_Pools.clear (); |
|
|
|
m_Pools.clear (); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -258,15 +258,18 @@ namespace tunnel |
|
|
|
TunnelPool * Tunnels::CreateTunnelPool (i2p::data::LocalDestination& localDestination) |
|
|
|
TunnelPool * Tunnels::CreateTunnelPool (i2p::data::LocalDestination& localDestination) |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto pool = new TunnelPool (localDestination); |
|
|
|
auto pool = new TunnelPool (localDestination); |
|
|
|
m_Pools.push_back (pool); |
|
|
|
m_Pools[pool->GetIdentHash ()] = pool; |
|
|
|
return pool; |
|
|
|
return pool; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Tunnels::DeleteTunnelPool (TunnelPool * pool) |
|
|
|
void Tunnels::DeleteTunnelPool (TunnelPool * pool) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_Pools.remove (pool); |
|
|
|
if (pool) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
m_Pools.erase (pool->GetIdentHash ()); |
|
|
|
delete pool; |
|
|
|
delete pool; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel) |
|
|
|
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -485,8 +488,8 @@ namespace tunnel |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (auto& it: m_Pools) |
|
|
|
for (auto& it: m_Pools) |
|
|
|
{ |
|
|
|
{ |
|
|
|
it->CreateTunnels (); |
|
|
|
it.second->CreateTunnels (); |
|
|
|
it->TestTunnels (); |
|
|
|
it.second->TestTunnels (); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|