mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 22:57:52 +00:00
probably fix hanging of call I2CP-SendMsgTo-FindLeaseSet
This commit is contained in:
parent
ff6a79bca3
commit
f79ad91a9a
@ -171,7 +171,7 @@ namespace client
|
|||||||
|
|
||||||
std::shared_ptr<const i2p::data::LeaseSet> LeaseSetDestination::FindLeaseSet (const i2p::data::IdentHash& ident)
|
std::shared_ptr<const i2p::data::LeaseSet> LeaseSetDestination::FindLeaseSet (const i2p::data::IdentHash& ident)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_RemoteLeaseSetsMutex);
|
std::unique_lock<std::mutex> lock(m_RemoteLeaseSetsMutex);
|
||||||
auto it = m_RemoteLeaseSets.find (ident);
|
auto it = m_RemoteLeaseSets.find (ident);
|
||||||
if (it != m_RemoteLeaseSets.end ())
|
if (it != m_RemoteLeaseSets.end ())
|
||||||
{
|
{
|
||||||
@ -186,7 +186,6 @@ namespace client
|
|||||||
{
|
{
|
||||||
ls->PopulateLeases();
|
ls->PopulateLeases();
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> _lock(m_RemoteLeaseSetsMutex);
|
|
||||||
m_RemoteLeaseSets[ident] = ls;
|
m_RemoteLeaseSets[ident] = ls;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,10 +202,7 @@ namespace client
|
|||||||
if (ls && !ls->IsExpired ())
|
if (ls && !ls->IsExpired ())
|
||||||
{
|
{
|
||||||
ls->PopulateLeases (); // since we don't store them in netdb
|
ls->PopulateLeases (); // since we don't store them in netdb
|
||||||
{
|
m_RemoteLeaseSets[ident] = ls;
|
||||||
std::lock_guard<std::mutex> lock(m_RemoteLeaseSetsMutex);
|
|
||||||
m_RemoteLeaseSets[ident] = ls;
|
|
||||||
}
|
|
||||||
return ls;
|
return ls;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user