netipmid: startSession does not need to call getSession
Change-Id: Id0e482705e8fda39270ec2e6c3534f81d11797b3
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
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 @@
}
}
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> 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> Active Session: 0x" << std::hex << std::setfill('0')
+ << std::setw(8) << (iterator.second)->getBMCSessionID()
+ << "\n";
}
-
- return getSession(sessionID);
+ throw std::runtime_error("No free sessions left");
}
bool Manager::stopSession(SessionID bmcSessionID)