aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-09-03 19:34:21 -0400
committerDeterminant <[email protected]>2018-09-03 19:34:21 -0400
commit3145cb1ae49ef94aecf8688329545e912e67a25f (patch)
tree86badd8351e25edccc52d006f8748952bb72868b
parent8611778efda37ff40ae9133010209a94dbb27865 (diff)
fix bug renders checksums useless
-rw-r--r--include/salticidae/msg.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/salticidae/msg.h b/include/salticidae/msg.h
index 3dec3dd..8c44bbb 100644
--- a/include/salticidae/msg.h
+++ b/include/salticidae/msg.h
@@ -66,6 +66,7 @@ class MsgBase {
MsgBase(const MsgType &msg): magic(0x0) {
set_opcode(MsgType::opcode);
set_payload(std::move(msg.serialized));
+ set_checksum();
}
MsgBase(const MsgBase &other):
@@ -168,6 +169,9 @@ class MsgBase {
no_payload = false;
#endif
length = payload.size();
+ }
+
+ void set_checksum() {
#ifndef SALTICIDAE_NOCHECKSUM
checksum = get_checksum();
#endif