From f19fe56a93d11c3788f24ea42a7bf460f7a86db6 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 27 Feb 2017 10:31:26 +0100 Subject: [PATCH] Better documentation about multimap usage --- libretroshare/src/services/p3gxsmails.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/services/p3gxsmails.h b/libretroshare/src/services/p3gxsmails.h index d1c74ea55..7941f8aa3 100644 --- a/libretroshare/src/services/p3gxsmails.h +++ b/libretroshare/src/services/p3gxsmails.h @@ -172,8 +172,12 @@ private: /** * @brief Ingoing mail and receipt processing queue. - * Items are saved in config and then deleted in destructor for consistence - * accross RetroShare shutdowns. + * At shutdown remaining items are saved in config and then deleted in + * destructor for consistence accross RetroShare instances. + * In order to avoid malicious messages ( non malicious collision has 1/2^64 + * probablity ) to smash items in the queue thus causing previous incoming + * item to not being processed and memleaked multimap is used instead of map + * for incoming queue. */ typedef std::unordered_multimap inMap; inMap ingoingQueue;