Browse Source

fixed race condition on session termination

pull/1776/head
orignal 2 years ago
parent
commit
16290bf66f
  1. 4
      libi2pd/SSU2Session.cpp

4
libi2pd/SSU2Session.cpp

@ -168,9 +168,7 @@ namespace transport @@ -168,9 +168,7 @@ namespace transport
{
m_State = eSSU2SessionStateTerminated;
m_ConnectTimer.cancel ();
transports.PeerDisconnected (shared_from_this ());
m_OnEstablished = nullptr;
m_Server.RemoveSession (m_SourceConnID);
if (m_RelayTag)
m_Server.RemoveRelay (m_RelayTag);
m_SentHandshakePacket.reset (nullptr);
@ -179,6 +177,8 @@ namespace transport @@ -179,6 +177,8 @@ namespace transport
m_IncompleteMessages.clear ();
m_RelaySessions.clear ();
m_PeerTests.clear ();
m_Server.RemoveSession (m_SourceConnID);
transports.PeerDisconnected (shared_from_this ());
LogPrint (eLogDebug, "SSU2: Session terminated");
}
}

Loading…
Cancel
Save