mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
fixed race condition
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user