Skip to content

Commit

Permalink
exclude failed tunnel from pool
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Mar 18, 2014
1 parent b34629b commit d938332
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions TunnelPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ namespace tunnel

void TunnelPool::TunnelExpired (InboundTunnel * expiredTunnel)
{
m_InboundTunnels.erase (expiredTunnel);
if (expiredTunnel)
{
expiredTunnel->SetTunnelPool (nullptr);
m_InboundTunnels.erase (expiredTunnel);
}
if (m_LocalDestination)
m_LocalDestination->UpdateLeaseSet ();
}
Expand All @@ -49,7 +53,11 @@ namespace tunnel

void TunnelPool::TunnelExpired (OutboundTunnel * expiredTunnel)
{
m_OutboundTunnels.erase (expiredTunnel);
if (expiredTunnel)
{
expiredTunnel->SetTunnelPool (nullptr);
m_OutboundTunnels.erase (expiredTunnel);
}
if (expiredTunnel == m_LastOutboundTunnel)
m_LastOutboundTunnel = nullptr;
}
Expand Down

0 comments on commit d938332

Please sign in to comment.