-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: Checksum check on decoder #14
Add: Checksum check on decoder #14
Conversation
780f26b
to
6d2eb01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question -- do we want to prohibit access to the message when the CRC is wrong, or do we want to allow the user to access it even if the CRC is wrong?
I think that would be better for us return the message inside the error enum |
@joaoantoniocardoso humm, then would be possible try to recover the msg, |
You only need to update ChecksumError declaration |
@joaoantoniocardoso thks for input. |
2434142
to
f923256
Compare
…ith failed message
5427e79
to
5ed1579
Compare
Actually, the checksum isn't checked on the decoder itself;
it's only verified when you attempt to build a ProtocolMessage from it.
PR propose validating it upon receipt and returning an error promptly.