mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
don't set unreachable twice
This commit is contained in:
parent
7a12b5ca4b
commit
6206616347
|
@ -466,7 +466,7 @@ namespace transport
|
||||||
auto profile = i2p::data::GetRouterProfile (ident);
|
auto profile = i2p::data::GetRouterProfile (ident);
|
||||||
if (profile && profile->IsUnreachable ())
|
if (profile && profile->IsUnreachable ())
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "Transports: Peer profile for ", ident.ToBase64 (), "reports unreachable. Dropped");
|
LogPrint (eLogWarning, "Transports: Peer profile for ", ident.ToBase64 (), " reports unreachable. Dropped");
|
||||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||||
m_Peers.erase (it);
|
m_Peers.erase (it);
|
||||||
return;
|
return;
|
||||||
|
@ -798,8 +798,12 @@ namespace transport
|
||||||
if (it->second.sessions.empty () && ts > it->second.creationTime + SESSION_CREATION_TIMEOUT)
|
if (it->second.sessions.empty () && ts > it->second.creationTime + SESSION_CREATION_TIMEOUT)
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "Transports: Session to peer ", it->first.ToBase64 (), " has not been created in ", SESSION_CREATION_TIMEOUT, " seconds");
|
LogPrint (eLogWarning, "Transports: Session to peer ", it->first.ToBase64 (), " has not been created in ", SESSION_CREATION_TIMEOUT, " seconds");
|
||||||
auto profile = i2p::data::GetRouterProfile (it->first);
|
if (!it->second.router)
|
||||||
if (profile) profile->Unreachable ();
|
{
|
||||||
|
// if router for ident not found mark it unreachable
|
||||||
|
auto profile = i2p::data::GetRouterProfile (it->first);
|
||||||
|
if (profile) profile->Unreachable ();
|
||||||
|
}
|
||||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||||
it = m_Peers.erase (it);
|
it = m_Peers.erase (it);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue