mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
fixed race condition
This commit is contained in:
parent
481b54a817
commit
711b4ab9ae
2 changed files with 6 additions and 0 deletions
|
@ -308,12 +308,16 @@ namespace garlic
|
|||
if (!session)
|
||||
{
|
||||
session = new GarlicRoutingSession (&destination, 32);
|
||||
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
||||
m_Sessions[destination.GetIdentHash ()] = session;
|
||||
}
|
||||
|
||||
I2NPMessage * ret = session->WrapSingleMessage (msg, leaseSet);
|
||||
if (!session->GetNextTag ()) // tags have beed recreated
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
||||
m_CreatedSessions[session->GetFirstMsgID ()] = session;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue