make internal command functor match external
The internal command functor was getting passed a
const message::Handler& instead of a std::shared_ptr<message::Handler>
which will not work with an upcoming patch that needs the functor to be
able to modify the Handler object. Also, it is convenient to have the
same signature for both types of handlers.
Tested: run ipmitool to see that behavior does not change.
Change-Id: Ie8660e4d16bd66eccc282aef2594b88c25b847db
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp
index ecb86e7..1413e6c 100644
--- a/command/payload_cmds.cpp
+++ b/command/payload_cmds.cpp
@@ -18,7 +18,7 @@
using namespace phosphor::logging;
std::vector<uint8_t> activatePayload(const std::vector<uint8_t>& inPayload,
- const message::Handler& handler)
+ std::shared_ptr<message::Handler>& handler)
{
auto request =
reinterpret_cast<const ActivatePayloadRequest*>(inPayload.data());
@@ -56,7 +56,7 @@
return outPayload;
}
- auto session = session::Manager::get().getSession(handler.sessionID);
+ auto session = session::Manager::get().getSession(handler->sessionID);
if (!request->encryption && session->isCryptAlgoEnabled())
{
@@ -84,13 +84,13 @@
}
// Set the current command's socket channel to the session
- handler.setChannelInSession();
+ handler->setChannelInSession();
// Start the SOL payload
try
{
sol::Manager::get().startPayloadInstance(request->payloadInstance,
- handler.sessionID);
+ handler->sessionID);
}
catch (std::exception& e)
{
@@ -109,8 +109,9 @@
return outPayload;
}
-std::vector<uint8_t> deactivatePayload(const std::vector<uint8_t>& inPayload,
- const message::Handler& handler)
+std::vector<uint8_t>
+ deactivatePayload(const std::vector<uint8_t>& inPayload,
+ std::shared_ptr<message::Handler>& handler)
{
auto request =
reinterpret_cast<const DeactivatePayloadRequest*>(inPayload.data());
@@ -180,8 +181,9 @@
return outPayload;
}
-std::vector<uint8_t> getPayloadStatus(const std::vector<uint8_t>& inPayload,
- const message::Handler& handler)
+std::vector<uint8_t>
+ getPayloadStatus(const std::vector<uint8_t>& inPayload,
+ std::shared_ptr<message::Handler>& handler)
{
auto request =
reinterpret_cast<const GetPayloadStatusRequest*>(inPayload.data());
@@ -214,7 +216,7 @@
}
std::vector<uint8_t> getPayloadInfo(const std::vector<uint8_t>& inPayload,
- const message::Handler& handler)
+ std::shared_ptr<message::Handler>& handler)
{
auto request =
reinterpret_cast<const GetPayloadInfoRequest*>(inPayload.data());