From 3145cb1ae49ef94aecf8688329545e912e67a25f Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 3 Sep 2018 19:34:21 -0400 Subject: fix bug renders checksums useless --- include/salticidae/msg.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') 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 -- cgit v1.2.3