msgpack-erlang icon indicating copy to clipboard operation
msgpack-erlang copied to clipboard

Conflict using Redis and msgpack-erlang with {spec, old} - {error,incomplete}

Open viplifes opened this issue 6 years ago • 1 comments

Erlang/OTP 20 Eshell V9.3 msgpack-erlang version 0.7.0

If you encode data with old spec msgpack:pack(List, [{spec, old}]). Then write the data in Redis and apply to the data cmsgpack.unpack and cmsgpack.pack Then decode the data in erlang msgpack:unpack(Binary, [{spec, old}]). We can receive {error, incomplete}

The old specification msgpack https://github.com/msgpack/msgpack/blob/master/spec-old.md does not use HEX 0xd9

But Redis cmsgpack.pack and cmsgpack.unpack allow the use of 0xd9 https://github.com/antirez/redis/blob/unstable/deps/lua/src/lua_cmsgpack.c#L182 https://github.com/antirez/redis/blob/unstable/deps/lua/src/lua_cmsgpack.c#L691

Now if use cmsgpack.pack and cmsgpack.unpack in Redis, you get {error, incomplete} in erlang.

Is it possible for the old specification to optionally allow the use of 0xd9?

Thank you!

viplifes avatar Mar 31 '18 13:03 viplifes

In msgpack-erlang version 0.3.6, everything works well with Redis.

viplifes avatar Mar 31 '18 13:03 viplifes