|
|
|
@ -282,8 +282,13 @@ namespace tunnel
@@ -282,8 +282,13 @@ namespace tunnel
|
|
|
|
|
for (const auto& it : m_OutboundTunnels) |
|
|
|
|
if (it->IsEstablished ()) num++; |
|
|
|
|
} |
|
|
|
|
for (int i = num; i < m_NumOutboundTunnels; i++) |
|
|
|
|
num = m_NumOutboundTunnels - num; |
|
|
|
|
if (num > 0) |
|
|
|
|
{ |
|
|
|
|
if (num > TUNNEL_POOL_MAX_NUM_BUILD_REQUESTS) num = TUNNEL_POOL_MAX_NUM_BUILD_REQUESTS; |
|
|
|
|
for (int i = 0; i < num; i++) |
|
|
|
|
CreateOutboundTunnel (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
num = 0; |
|
|
|
|
{ |
|
|
|
@ -300,8 +305,13 @@ namespace tunnel
@@ -300,8 +305,13 @@ namespace tunnel
|
|
|
|
|
if (num >= m_NumInboundTunnels) break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (int i = num; i < m_NumInboundTunnels; i++) |
|
|
|
|
num = m_NumInboundTunnels - num; |
|
|
|
|
if (num > 0) |
|
|
|
|
{ |
|
|
|
|
if (num > TUNNEL_POOL_MAX_NUM_BUILD_REQUESTS) num = TUNNEL_POOL_MAX_NUM_BUILD_REQUESTS; |
|
|
|
|
for (int i = 0; i < num; i++) |
|
|
|
|
CreateInboundTunnel (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (num < m_NumInboundTunnels && m_NumInboundHops <= 0 && m_LocalDestination) // zero hops IB
|
|
|
|
|
m_LocalDestination->SetLeaseSetUpdated (); // update LeaseSet immediately
|
|
|
|
|