mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Change CMessageHeader Constructor
This commit removes the single-parameter contructor of CMessageHeader and replaces it with a default constructor. The single parameter contructor isn't used anywhere except for tests. There is no reason to initialize a CMessageHeader with a particular messagestart. This messagestart should always be replaced when deserializing an actual message header so that we can run checks on it. The default constructor initializes it to zero, just like the command and checksum. This also removes a parameter of a V1TransportDeserializer constructor, as it was only used for this purpose.
This commit is contained in:
parent
1ca20c1af8
commit
5bceef6b12
6 changed files with 7 additions and 8 deletions
|
|
@ -84,9 +84,9 @@ const static std::string allNetMessageTypes[] = {
|
|||
};
|
||||
const static std::vector<std::string> allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes));
|
||||
|
||||
CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn)
|
||||
CMessageHeader::CMessageHeader()
|
||||
{
|
||||
memcpy(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE);
|
||||
memset(pchMessageStart, 0, MESSAGE_START_SIZE);
|
||||
memset(pchCommand, 0, sizeof(pchCommand));
|
||||
nMessageSize = -1;
|
||||
memset(pchChecksum, 0, CHECKSUM_SIZE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue