check for duplicate msgID

This commit is contained in:
orignal 2015-02-04 22:16:44 -05:00
parent 9896570e32
commit 0dac2a74d3

View File

@ -114,9 +114,14 @@ namespace tunnel
if (!isFollowOnFragment) // create new incomlete message
{
m.nextFragmentNum = 1;
auto& msg = m_IncompleteMessages[msgID];
msg = m;
HandleOutOfSequenceFragment (msgID, msg);
auto ret = m_IncompleteMessages.insert (std::pair<uint32_t, TunnelMessageBlockEx>(msgID, m));
if (ret.second)
HandleOutOfSequenceFragment (msgID, ret.first->second);
else
{
LogPrint (eLogError, "Incomplete message ", msgID, "already exists");
DeleteI2NPMessage (m.data);
}
}
else
{