Browse Source

drop unsent messages if session disconnects

pull/2013/head
orignal 11 months ago
parent
commit
0ca782ed71
  1. 2
      libi2pd/NTCP2.cpp
  2. 2
      libi2pd/SSU2Session.cpp

2
libi2pd/NTCP2.cpp

@ -373,6 +373,8 @@ namespace transport @@ -373,6 +373,8 @@ namespace transport
m_Socket.close ();
transports.PeerDisconnected (shared_from_this ());
m_Server.RemoveNTCP2Session (shared_from_this ());
for (auto& it: m_SendQueue)
it->Drop ();
m_SendQueue.clear ();
SetSendQueueSize (0);
auto remoteIdentity = GetRemoteIdentity ();

2
libi2pd/SSU2Session.cpp

@ -262,6 +262,8 @@ namespace transport @@ -262,6 +262,8 @@ namespace transport
m_SentHandshakePacket.reset (nullptr);
m_SessionConfirmedFragment.reset (nullptr);
m_PathChallenge.reset (nullptr);
for (auto& it: m_SendQueue)
it->Drop ();
m_SendQueue.clear ();
SetSendQueueSize (0);
m_SentPackets.clear ();

Loading…
Cancel
Save