check tunnel status instead fidning it every time

This commit is contained in:
orignal 2015-01-27 22:31:57 -05:00
parent 763547f465
commit 192a08b5bf
3 changed files with 11 additions and 15 deletions

View file

@ -504,7 +504,8 @@ namespace stream
return;
}
}
m_CurrentOutboundTunnel = m_LocalDestination.GetOwner ().GetTunnelPool ()->GetNextOutboundTunnel (m_CurrentOutboundTunnel);
if (!m_CurrentOutboundTunnel || !m_CurrentOutboundTunnel->IsEstablished ())
m_CurrentOutboundTunnel = m_LocalDestination.GetOwner ().GetTunnelPool ()->GetNextOutboundTunnel ();
if (!m_CurrentOutboundTunnel)
{
LogPrint ("No outbound tunnels in the pool");