From 830edf8bc2c55e1ef4bf907e80251ea8a12b25d4 Mon Sep 17 00:00:00 2001 From: iamsi Date: Wed, 24 Feb 2021 14:53:38 +0000 Subject: [PATCH] Correct last frame reflection issue (#1) * Correct last frame reflection issue There's a bug in this version that reflects the last frame to the sender, this is the change from upstream that corrects the issue. * Update comment Adding the comment from upstream. --- src/cprotocol.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cprotocol.cpp b/src/cprotocol.cpp index deca34c..c4c39bb 100644 --- a/src/cprotocol.cpp +++ b/src/cprotocol.cpp @@ -183,8 +183,12 @@ void CProtocol::OnDvLastFramePacketIn(std::unique_ptr &Frame stream->Push(std::move(Frame)); stream->Unlock(); - // and close the stream - g_Reflector.CloseStream(stream); + // Don't close yet, this stops the last packet relfection bug that was fixed in upstream by the same change. + // Don't close the stream yet but rely on CheckStreamsTimeout + // mechanism, so the stream will be closed after the queues have + // been sinked out. This avoid last packets to be send back + // to transmitting client (master) + } // else // {