mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
create paired inbound tunnels if no inbound tunnels yet
This commit is contained in:
parent
1f6be38145
commit
af20b13c7a
@ -118,7 +118,6 @@ namespace tunnel
|
|||||||
std::unique_lock<std::mutex> l(m_OutboundTunnelsMutex);
|
std::unique_lock<std::mutex> l(m_OutboundTunnelsMutex);
|
||||||
m_OutboundTunnels.insert (createdTunnel);
|
m_OutboundTunnels.insert (createdTunnel);
|
||||||
}
|
}
|
||||||
//CreatePairedInboundTunnel (createdTunnel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TunnelPool::TunnelExpired (std::shared_ptr<OutboundTunnel> expiredTunnel)
|
void TunnelPool::TunnelExpired (std::shared_ptr<OutboundTunnel> expiredTunnel)
|
||||||
@ -235,6 +234,15 @@ namespace tunnel
|
|||||||
for (const auto& it : m_InboundTunnels)
|
for (const auto& it : m_InboundTunnels)
|
||||||
if (it->IsEstablished ()) num++;
|
if (it->IsEstablished ()) num++;
|
||||||
}
|
}
|
||||||
|
if (!num && !m_OutboundTunnels.empty ())
|
||||||
|
{
|
||||||
|
for (auto it: m_OutboundTunnels)
|
||||||
|
{
|
||||||
|
CreatePairedInboundTunnel (it);
|
||||||
|
num++;
|
||||||
|
if (num >= m_NumInboundTunnels) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int i = num; i < m_NumInboundTunnels; i++)
|
for (int i = num; i < m_NumInboundTunnels; i++)
|
||||||
CreateInboundTunnel ();
|
CreateInboundTunnel ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user