diff options
author | Determinant <[email protected]> | 2018-09-03 19:34:21 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-09-03 19:34:21 -0400 |
commit | 3145cb1ae49ef94aecf8688329545e912e67a25f (patch) | |
tree | 86badd8351e25edccc52d006f8748952bb72868b /include | |
parent | 8611778efda37ff40ae9133010209a94dbb27865 (diff) |
fix bug renders checksums useless
Diffstat (limited to 'include')
-rw-r--r-- | include/salticidae/msg.h | 4 |
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 |