From 6f2bb4125d7e4cd9baaf812c3dcd118883f65e71 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 24 Jun 2020 02:02:57 +0200 Subject: [PATCH] bugfix --- housekeeping/HousekeepingMessage.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/housekeeping/HousekeepingMessage.cpp b/housekeeping/HousekeepingMessage.cpp index 64b07c17..2335f03d 100644 --- a/housekeeping/HousekeepingMessage.cpp +++ b/housekeeping/HousekeepingMessage.cpp @@ -8,21 +8,16 @@ void HousekeepingMessage::setHkReportMessage(CommandMessage* message, sid_t sid, message->setCommand(HK_REPORT); message->setMessageSize(HK_MESSAGE_SIZE); setSid(message, sid); - message->setParameter(storeId.raw); + setParameter(message, storeId.raw); } void HousekeepingMessage::setHkDiagnosticsMessage(CommandMessage* message, sid_t sid, store_address_t storeId) { message->setCommand(DIAGNOSTICS_REPORT); + message->setMessageSize(HK_MESSAGE_SIZE); setSid(message, sid); setParameter(message, storeId.raw); } -sid_t HousekeepingMessage::getSid(const CommandMessage* message) { - sid_t sid; - std::memcpy(&sid.raw, message->getData(), sizeof(sid.raw)); - return sid; -} - sid_t HousekeepingMessage::getHkReportMessage(const CommandMessage *message, store_address_t *storeIdToSet) { @@ -32,6 +27,12 @@ sid_t HousekeepingMessage::getHkReportMessage(const CommandMessage *message, return getSid(message); } +sid_t HousekeepingMessage::getSid(const CommandMessage* message) { + sid_t sid; + std::memcpy(&sid.raw, message->getData(), sizeof(sid.raw)); + return sid; +} + void HousekeepingMessage::setSid(CommandMessage *message, sid_t sid) { std::memcpy(message->getData(), &sid.raw, sizeof(sid.raw)); }