Skip to content

verifyBeforeRead could use some additional "Probably not what you want" verbage in CommsDSL_Specification, or maybe an implementation change? #2

@dodohand

Description

@dodohand

I ran into a situation where verifyBeforeRead="true" with first frame byte being the size field and last frame byte being a checksum led to the checksum being calculated over all received bytes, rather that all bytes of a frame excluding the checksum byte.
This may or may not be how you expect it to behave - it wasn't what I expected though, as it makes very little sense to me to calculate the checksum if you haven't read the size field. I can think of two possible improvements:

  1. try to read the size and then calculate checksum,
  2. Add some verbage to the 'verifyBeforeRead' documentation along these lines:
  • verifyBeforeRead can be dangerous: verifyBeforeRead="true" causes a checksum calculation across all received bytes prior to evaluation of the 'size' layer. If you may receive multiple frames consecutively(, or partial frames ?), this can lead to frames being discarded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions