only remove message when it successfully parses and handles

This commit is contained in:
Jeff Becker 2018-12-27 13:31:19 -05:00
parent ec57c72e08
commit 874b1cd53c
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -1088,7 +1088,8 @@ namespace llarp
llarp::LogDebug("got message ", msgid, " from ", remoteAddr); llarp::LogDebug("got message ", msgid, " from ", remoteAddr);
result = parent->HandleMessage(this, buf); result = parent->HandleMessage(this, buf);
// get rid of message buffer // get rid of message buffer
m_RecvMsgs.erase(itr); if(result)
m_RecvMsgs.erase(itr->first);
} }
return result; return result;
} }