Skip to content

Commit

Permalink
Update MessageReceiverPlugin.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
arayama authored Dec 23, 2021
1 parent 558408f commit 19f17b3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ int MessageReceiverPlugin::Main()
uint64_t time = Clock::GetMillisecondsSinceEpoch();

totalBytes += len;
int txlen=0;

// @SONAR_STOP@
// if verification enabled, access HSM
Expand Down Expand Up @@ -553,6 +554,7 @@ int MessageReceiverPlugin::Main()
string bs = extractedmsg.substr(i, 2);
uint8_t byte = (uint8_t) strtol(bs.c_str(), nullptr, 16);
extractedpayload[k++]=byte;
txlen++;

}
break; // can break out if already found a msg id
Expand All @@ -575,7 +577,8 @@ int MessageReceiverPlugin::Main()

}
else {
extractedpayload=incoming;
extractedpayload=incoming;
txlen=len;
}

// @SONAR_START@
Expand All @@ -600,7 +603,7 @@ int MessageReceiverPlugin::Main()
}
}

this->IncomingMessage(extractedpayload.data(), extractedpayload.size(), enc.empty() ? NULL : enc.c_str(), 0, 0, time);
this->IncomingMessage(extractedpayload.data(), txlen, enc.empty() ? NULL : enc.c_str(), 0, 0, time);

}
else if (len < 0)
Expand Down

0 comments on commit 19f17b3

Please sign in to comment.