From 714d1cc993433de29b79ff1d777e1f82c0b0cc28 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 8 May 2022 11:49:11 -0400 Subject: [PATCH] close stream if delete requested --- libi2pd/Streaming.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index 71b25f1c..81c09c84 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -1285,7 +1285,12 @@ namespace stream auto it = m_Streams.find (recvStreamID); if (it == m_Streams.end ()) return false; - DeleteStream (it->second); + m_Owner->GetService ().post ([this, s = it->second]() + { + s->Close (); // try to send FIN + s->Terminate (false); + DeleteStream (s); + }); return true; }