mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
pick tunnels from exploratory pool for exploratory
This commit is contained in:
parent
13b2036e52
commit
24f0ff6c00
4 changed files with 23 additions and 3 deletions
|
@ -86,7 +86,22 @@ namespace tunnel
|
|||
m_LastOutboundTunnel = tunnel;
|
||||
return tunnel;
|
||||
}
|
||||
|
||||
|
||||
InboundTunnel * TunnelPool::GetNextInboundTunnel ()
|
||||
{
|
||||
return GetNextTunnel (m_InboundTunnels);
|
||||
}
|
||||
|
||||
template<class TTunnels>
|
||||
typename TTunnels::value_type TunnelPool::GetNextTunnel (TTunnels& tunnels)
|
||||
{
|
||||
if (tunnels.empty ()) return nullptr;
|
||||
for (auto it: tunnels)
|
||||
if (!it->IsFailed ())
|
||||
return it;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void TunnelPool::CreateTunnels ()
|
||||
{
|
||||
int num = m_InboundTunnels.size ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue