netipmid: use std::shared_ptr instead of weak_ptr/lock
All of the instances of getSession and startSession were assigning the
result to a local shared_ptr via lock on the weak_ptr. It doesn't make
sense to demote the shared_ptr (from the sessionsMap) to a weak_ptr via
the return, only to promote to a shared_ptr again via lock.
Tested-by: running ipmitool -H a.b.c.d -P 0penBmc -I lanplus mc info
Sessions start and stop, same as before.
Change-Id: Ic10779285891d73ee51115f16ed0000b38d1c52a
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/command/open_session.cpp b/command/open_session.cpp
index b41eefa..b48b7e9 100644
--- a/command/open_session.cpp
+++ b/command/open_session.cpp
@@ -50,16 +50,15 @@
{
// Start an IPMI session
session =
- (std::get<session::Manager&>(singletonPool)
- .startSession(
- endian::from_ipmi<>(request->remoteConsoleSessionID),
- static_cast<session::Privilege>(request->maxPrivLevel),
- static_cast<cipher::rakp_auth::Algorithms>(
- request->authAlgo),
- static_cast<cipher::integrity::Algorithms>(
- request->intAlgo),
- static_cast<cipher::crypt::Algorithms>(request->confAlgo)))
- .lock();
+ std::get<session::Manager&>(singletonPool)
+ .startSession(
+ endian::from_ipmi<>(request->remoteConsoleSessionID),
+ static_cast<session::Privilege>(request->maxPrivLevel),
+ static_cast<cipher::rakp_auth::Algorithms>(
+ request->authAlgo),
+ static_cast<cipher::integrity::Algorithms>(
+ request->intAlgo),
+ static_cast<cipher::crypt::Algorithms>(request->confAlgo));
}
catch (std::exception& e)
{