Skip to content

msgpack.js -> overSized buffers generate an error, when it (probably) shouldn't #20

Description

@prochat

Line 264:
//if (decoder.offset !== buffer.length) throw new Error((buffer.length - deco
der.offset) + " trailing bytes");

Prevents larger buffer containing a shorter msgpack content to be decoded (I commented it out).

My situation is the following: I use a block Ciphering methods to transmit data (with LoRa). Buffers are then multiple of 16, and my msg has trailing 0. I cannot remove those trailing 0 (it could be part of the msgpacked content).
I'm using msgpack.js with node-red-node-msgpack.

A workaround would be to send also mspack length in the message, that would be in contradiction with the "as short as possible" characteristic of msgpack. And I think a msgpack message in a larger buffer has to be considered as valid.

Regards,
Ph.R.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions