From 874b1cd53c25265f2b214a7e367d1c92c3c460b6 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 27 Dec 2018 13:31:19 -0500 Subject: [PATCH] only remove message when it successfully parses and handles --- llarp/link/utp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llarp/link/utp.cpp b/llarp/link/utp.cpp index 6a45ad1fa..35b058628 100644 --- a/llarp/link/utp.cpp +++ b/llarp/link/utp.cpp @@ -1088,7 +1088,8 @@ namespace llarp llarp::LogDebug("got message ", msgid, " from ", remoteAddr); result = parent->HandleMessage(this, buf); // get rid of message buffer - m_RecvMsgs.erase(itr); + if(result) + m_RecvMsgs.erase(itr->first); } return result; }