netipmid: use shared_ptr on session instead of shared_ptr+references
session objects were being created and held by shared_ptr objects and
then shared via reference. This is dangerous and sidesteps the whole
point of a shared_ptr, which is to share reference-counted ownership.
This replaces the usage with a shared_ptr, which shows shared ownership.
Change-Id: Ie22d812a6d260d606201eca6a9011e773c89e487
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/message_parsers.hpp b/message_parsers.hpp
index b38da40..489eb23 100644
--- a/message_parsers.hpp
+++ b/message_parsers.hpp
@@ -73,7 +73,8 @@
* @return IPMI packet on success
*/
std::vector<uint8_t> flatten(std::shared_ptr<Message> outMessage,
- SessionHeader authType, session::Session& session);
+ SessionHeader authType,
+ std::shared_ptr<session::Session> session);
} // namespace parser
@@ -112,7 +113,7 @@
* @return IPMI packet on success
*/
std::vector<uint8_t> flatten(std::shared_ptr<Message> outMessage,
- session::Session& session);
+ std::shared_ptr<session::Session> session);
} // namespace ipmi15parser
@@ -159,7 +160,7 @@
* @return IPMI packet on success
*/
std::vector<uint8_t> flatten(std::shared_ptr<Message> outMessage,
- session::Session& session);
+ std::shared_ptr<session::Session> session);
namespace internal
{
@@ -171,7 +172,8 @@
* @param[in] session - session handle
*
*/
-void addSequenceNumber(std::vector<uint8_t>& packet, session::Session& session);
+void addSequenceNumber(std::vector<uint8_t>& packet,
+ std::shared_ptr<session::Session> session);
/**
* @brief Verify the integrity data of the incoming IPMI packet