You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 18, 2020. It is now read-only.
I've been doing interop with other msgpack libraries this weekend, namely the official msgpack-javascript.
The problem is that we currently call _emit_map_len() before encoding a Rust struct into the stream.
This pops the msgpack type fixmap (0x8<len>) onto the stream.
However when encoding struct fields we only encode the value of the field, which means this is not a valid msgpack map entry.
The fix involves emitting the field-name when encoding; and reading/checking the field-name when decoding.
Again this only affects non-Rust readers: as they are expecting a map-key where one is not present. In my experience this means the fixmap is decoded into a single key (containing all the bytes of the struct) and then the rest of the stream is corrupted.
Would such a fix be welcome? Though it changes the semantics of how we're encoding structs?