mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-08 22:13:48 +01:00
don't remove another NTCP2 session with same address
This commit is contained in:
parent
140146e433
commit
0b47f65b06
1 changed files with 5 additions and 1 deletions
|
@ -1415,7 +1415,11 @@ namespace transport
|
||||||
void NTCP2Server::RemoveNTCP2Session (std::shared_ptr<NTCP2Session> session)
|
void NTCP2Server::RemoveNTCP2Session (std::shared_ptr<NTCP2Session> session)
|
||||||
{
|
{
|
||||||
if (session && session->GetRemoteIdentity ())
|
if (session && session->GetRemoteIdentity ())
|
||||||
m_NTCP2Sessions.erase (session->GetRemoteIdentity ()->GetIdentHash ());
|
{
|
||||||
|
auto it = m_NTCP2Sessions.find (session->GetRemoteIdentity ()->GetIdentHash ());
|
||||||
|
if (it != m_NTCP2Sessions.end () && it->second == session)
|
||||||
|
m_NTCP2Sessions.erase (it);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<NTCP2Session> NTCP2Server::FindNTCP2Session (const i2p::data::IdentHash& ident)
|
std::shared_ptr<NTCP2Session> NTCP2Server::FindNTCP2Session (const i2p::data::IdentHash& ident)
|
||||||
|
|
Loading…
Add table
Reference in a new issue