mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
fixed deadlock
This commit is contained in:
@@ -364,17 +364,21 @@ namespace tunnel
|
|||||||
if (it.second.second->GetState () == eTunnelStateTestFailed)
|
if (it.second.second->GetState () == eTunnelStateTestFailed)
|
||||||
{
|
{
|
||||||
it.second.second->SetState (eTunnelStateFailed);
|
it.second.second->SetState (eTunnelStateFailed);
|
||||||
|
{
|
||||||
|
bool failed = false;
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
||||||
if (m_InboundTunnels.size () > 1 || m_NumInboundTunnels <= 1) // don't fail last tunnel
|
if (m_InboundTunnels.size () > 1 || m_NumInboundTunnels <= 1) // don't fail last tunnel
|
||||||
{
|
{
|
||||||
m_InboundTunnels.erase (it.second.second);
|
m_InboundTunnels.erase (it.second.second);
|
||||||
if (m_LocalDestination)
|
failed = true;
|
||||||
m_LocalDestination->SetLeaseSetUpdated ();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
it.second.second->SetState (eTunnelStateTestFailed);
|
it.second.second->SetState (eTunnelStateTestFailed);
|
||||||
}
|
}
|
||||||
|
if (failed && m_LocalDestination)
|
||||||
|
m_LocalDestination->SetLeaseSetUpdated ();
|
||||||
|
}
|
||||||
if (m_LocalDestination)
|
if (m_LocalDestination)
|
||||||
m_LocalDestination->SetLeaseSetUpdated ();
|
m_LocalDestination->SetLeaseSetUpdated ();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user