diff options
author | Vernon Mauery <vernon.mauery@linux.intel.com> | 2018-10-26 10:15:03 -0700 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2018-11-21 10:51:29 -0800 |
commit | 4cb73595dd5716e8767d1dcab9496ccb4c0dd8f4 (patch) | |
tree | 52b943ecd295996548b15240cc552ceb3bcf2dbb | |
parent | 224f36a4e5b10ac3f84958307a61687cc041d064 (diff) | |
download | phosphor-net-ipmid-4cb73595dd5716e8767d1dcab9496ccb4c0dd8f4.tar.gz phosphor-net-ipmid-4cb73595dd5716e8767d1dcab9496ccb4c0dd8f4.zip |
netipmid: startSession does not need to call getSession
Change-Id: Id0e482705e8fda39270ec2e6c3534f81d11797b3
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
-rw-r--r-- | sessions_manager.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sessions_manager.cpp b/sessions_manager.cpp index 52d749b..1a70b49 100644 --- a/sessions_manager.cpp +++ b/sessions_manager.cpp @@ -85,23 +85,20 @@ std::shared_ptr<Session> } } sessionID = session->getBMCSessionID(); - sessionsMap.emplace(sessionID, std::move(session)); + sessionsMap.emplace(sessionID, session); + return session; } - else - { - std::cerr << "E> No free sessions left: Active: " << activeSessions - << " Allowed: " << MAX_SESSION_COUNT << "\n"; - for (const auto& iterator : sessionsMap) - { - std::cerr << "E> Active Session: 0x" << std::hex - << std::setfill('0') << std::setw(8) - << (iterator.second)->getBMCSessionID() << "\n"; - } - throw std::runtime_error("No free sessions left"); - } + std::cerr << "E> No free sessions left: Active: " << activeSessions + << " Allowed: " << MAX_SESSION_COUNT << "\n"; - return getSession(sessionID); + for (const auto& iterator : sessionsMap) + { + std::cerr << "E> Active Session: 0x" << std::hex << std::setfill('0') + << std::setw(8) << (iterator.second)->getBMCSessionID() + << "\n"; + } + throw std::runtime_error("No free sessions left"); } bool Manager::stopSession(SessionID bmcSessionID) |