mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-21 06:41:48 +02:00
move unsent I2NP messages to new session if replaced
This commit is contained in:
parent
4100249313
commit
a1322d4667
3 changed files with 21 additions and 2 deletions
libi2pd
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue