MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / RemoveSession

Method RemoveSession

libi2pd/SSU2.cpp:511–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509 }
510
511 void SSU2Server::RemoveSession (uint64_t connID)
512 {
513 auto it = m_Sessions.find (connID);
514 if (it != m_Sessions.end ())
515 {
516 if (it->second->GetState () != eSSU2SessionStatePeerTest)
517 {
518 auto ident = it->second->GetRemoteIdentity ();
519 if (ident)
520 {
521 std::lock_guard<std::mutex> l(m_SessionsByRouterHashMutex);
522 auto it1 = m_SessionsByRouterHash.find (ident->GetIdentHash ());
523 if (it1 != m_SessionsByRouterHash.end () && it->second == it1->second.lock ())
524 m_SessionsByRouterHash.erase (it1);
525 }
526 }
527 if (m_LastSession == it->second)
528 m_LastSession = nullptr;
529 m_Sessions.erase (it);
530 }
531 }
532
533 void SSU2Server::RequestRemoveSession (uint64_t connID)
534 {

Callers 2

TerminateMethod · 0.45

Calls 2

GetStateMethod · 0.45
GetRemoteIdentityMethod · 0.45

Tested by

no test coverage detected