mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
move unsent I2NP messages to new session if replaced
This commit is contained in:
@@ -455,10 +455,12 @@ namespace transport
|
||||
if (ident)
|
||||
{
|
||||
auto ret = m_SessionsByRouterHash.emplace (ident->GetIdentHash (), session);
|
||||
if (!ret.second)
|
||||
if (!ret.second && ret.first->second != session)
|
||||
{
|
||||
// session already exists
|
||||
LogPrint (eLogWarning, "SSU2: Session to ", ident->GetIdentHash ().ToBase64 (), " already exists");
|
||||
// move unsent msgs to new session
|
||||
ret.first->second->MoveSendQueue (session);
|
||||
// terminate existing
|
||||
GetService ().post (std::bind (&SSU2Session::RequestTermination, ret.first->second, eSSU2TerminationReasonReplacedByNewSession));
|
||||
// update session
|
||||
|
||||
Reference in New Issue
Block a user