1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-18 16:49:58 +00:00

drop unsent messages if session disconnects

This commit is contained in:
orignal 2024-01-30 18:02:14 -05:00
parent e40b656ecf
commit 0ca782ed71
2 changed files with 4 additions and 0 deletions

View File

@ -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 ();

View File

@ -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 ();