|
|
@ -491,12 +491,15 @@ namespace tunnel |
|
|
|
outboundTunnel = tunnels.GetNextOutboundTunnel (); |
|
|
|
outboundTunnel = tunnels.GetNextOutboundTunnel (); |
|
|
|
LogPrint (eLogDebug, "Tunnels: Re-creating destination inbound tunnel..."); |
|
|
|
LogPrint (eLogDebug, "Tunnels: Re-creating destination inbound tunnel..."); |
|
|
|
std::shared_ptr<TunnelConfig> config; |
|
|
|
std::shared_ptr<TunnelConfig> config; |
|
|
|
if (m_NumInboundHops > 0) config = std::make_shared<TunnelConfig>(tunnel->GetPeers ()); |
|
|
|
if (m_NumInboundHops > 0 && tunnel->GetPeers().size() > 0) config = std::make_shared<TunnelConfig>(tunnel->GetPeers ()); |
|
|
|
|
|
|
|
if (m_NumInboundHops == 0 || config) |
|
|
|
|
|
|
|
{ |
|
|
|
auto newTunnel = tunnels.CreateInboundTunnel (config, outboundTunnel); |
|
|
|
auto newTunnel = tunnels.CreateInboundTunnel (config, outboundTunnel); |
|
|
|
newTunnel->SetTunnelPool (shared_from_this()); |
|
|
|
newTunnel->SetTunnelPool (shared_from_this()); |
|
|
|
if (newTunnel->IsEstablished ()) // zero hops
|
|
|
|
if (newTunnel->IsEstablished ()) // zero hops
|
|
|
|
TunnelCreated (newTunnel); |
|
|
|
TunnelCreated (newTunnel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TunnelPool::CreateOutboundTunnel () |
|
|
|
void TunnelPool::CreateOutboundTunnel () |
|
|
|
{ |
|
|
|
{ |
|
|
@ -533,13 +536,18 @@ namespace tunnel |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogDebug, "Tunnels: Re-creating destination outbound tunnel..."); |
|
|
|
LogPrint (eLogDebug, "Tunnels: Re-creating destination outbound tunnel..."); |
|
|
|
std::shared_ptr<TunnelConfig> config; |
|
|
|
std::shared_ptr<TunnelConfig> config; |
|
|
|
if (m_NumOutboundHops > 0) |
|
|
|
if (tunnel->GetPeers().size() > 0 && m_NumOutboundHops > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
config = std::make_shared<TunnelConfig>(tunnel->GetPeers (), inboundTunnel->GetNextTunnelID (), inboundTunnel->GetNextIdentHash ()); |
|
|
|
config = std::make_shared<TunnelConfig>(tunnel->GetPeers (), inboundTunnel->GetNextTunnelID (), inboundTunnel->GetNextIdentHash ()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(m_NumOutboundHops == 0 || config) |
|
|
|
|
|
|
|
{ |
|
|
|
auto newTunnel = tunnels.CreateOutboundTunnel (config); |
|
|
|
auto newTunnel = tunnels.CreateOutboundTunnel (config); |
|
|
|
newTunnel->SetTunnelPool (shared_from_this ()); |
|
|
|
newTunnel->SetTunnelPool (shared_from_this ()); |
|
|
|
if (newTunnel->IsEstablished ()) // zero hops
|
|
|
|
if (newTunnel->IsEstablished ()) // zero hops
|
|
|
|
TunnelCreated (newTunnel); |
|
|
|
TunnelCreated (newTunnel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
LogPrint (eLogDebug, "Tunnels: Can't re-create outbound tunnel, no inbound tunnels found"); |
|
|
|
LogPrint (eLogDebug, "Tunnels: Can't re-create outbound tunnel, no inbound tunnels found"); |
|
|
|
} |
|
|
|
} |
|
|
|