Skip to content

Commit

Permalink
unpack: unpacker_next_with_size() update parsed bytes on success or c…
Browse files Browse the repository at this point in the history
…ontinue

This patch makes unpacker_next_with_size(...), update p_bytes when
unpacker_next() returns MSGPACK_UNPACK_SUCCESS or MSGPACK_UNPACK_CONTINUE.

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Sep 6, 2016
1 parent d9a77e2 commit b90bcf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,11 @@ msgpack_unpacker_next_with_size(msgpack_unpacker* mpac,
int ret;

ret = unpacker_next(mpac, result);
if (ret == MSGPACK_UNPACK_SUCCESS) {
if (ret == MSGPACK_UNPACK_SUCCESS || ret == MSGPACK_UNPACK_CONTINUE) {
*p_bytes = mpac->parsed;
}

if (ret == MSGPACK_UNPACK_SUCCESS) {
msgpack_unpacker_reset(mpac);
}

Expand Down

0 comments on commit b90bcf3

Please sign in to comment.