mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-23 17:36:37 +02:00
cleanup terminated sessions
This commit is contained in:
parent
b5d139f7b2
commit
a99fcfe54f
1 changed files with 5 additions and 1 deletions
|
@ -376,6 +376,9 @@ namespace transport
|
||||||
m_LastSession->SetRemoteEndpoint (senderEndpoint);
|
m_LastSession->SetRemoteEndpoint (senderEndpoint);
|
||||||
m_LastSession->ProcessPeerTest (buf, len);
|
m_LastSession->ProcessPeerTest (buf, len);
|
||||||
break;
|
break;
|
||||||
|
case eSSU2SessionStateTerminated:
|
||||||
|
m_LastSession = nullptr;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LogPrint (eLogWarning, "SSU2: Invalid session state ", (int)m_LastSession->GetState ());
|
LogPrint (eLogWarning, "SSU2: Invalid session state ", (int)m_LastSession->GetState ());
|
||||||
}
|
}
|
||||||
|
@ -608,7 +611,8 @@ namespace transport
|
||||||
|
|
||||||
for (auto it = m_Sessions.begin (); it != m_Sessions.end ();)
|
for (auto it = m_Sessions.begin (); it != m_Sessions.end ();)
|
||||||
{
|
{
|
||||||
if (it->second->IsTerminationTimeoutExpired (ts))
|
if (it->second->GetState () == eSSU2SessionStateTerminated ||
|
||||||
|
it->second->IsTerminationTimeoutExpired (ts))
|
||||||
{
|
{
|
||||||
if (it->second->IsEstablished ())
|
if (it->second->IsEstablished ())
|
||||||
it->second->TerminateByTimeout ();
|
it->second->TerminateByTimeout ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue