diff options
author | Vernon Mauery <vernon.mauery@linux.intel.com> | 2018-10-15 12:55:34 -0700 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2018-11-06 15:42:37 -0800 |
commit | ae1fda44032a361874417c4006ddcbd951974399 (patch) | |
tree | c179b19c47cdb3ef0114b89385370fc6a144614b /sessions_manager.cpp | |
parent | 9e801a2b5b36acd307606af5eafdb885dfe8daee (diff) | |
download | phosphor-net-ipmid-ae1fda44032a361874417c4006ddcbd951974399.tar.gz phosphor-net-ipmid-ae1fda44032a361874417c4006ddcbd951974399.zip |
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>
Diffstat (limited to 'sessions_manager.cpp')
-rw-r--r-- | sessions_manager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sessions_manager.cpp b/sessions_manager.cpp index 10c2764..bf7ff34 100644 --- a/sessions_manager.cpp +++ b/sessions_manager.cpp @@ -24,7 +24,7 @@ Manager::Manager() std::srand(std::time(0)); } -std::weak_ptr<Session> +std::shared_ptr<Session> Manager::startSession(SessionID remoteConsoleSessID, Privilege priv, cipher::rakp_auth::Algorithms authAlgo, cipher::integrity::Algorithms intAlgo, @@ -120,8 +120,8 @@ bool Manager::stopSession(SessionID bmcSessionID) } } -std::weak_ptr<Session> Manager::getSession(SessionID sessionID, - RetrieveOption option) +std::shared_ptr<Session> Manager::getSession(SessionID sessionID, + RetrieveOption option) { switch (option) { |