mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-27 18:30:53 +02:00
unpack: unpacker_next_with_size() update parsed bytes on success or continue
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 <eduardo@treasure-data.com>
This commit is contained in:
parent
d9a77e220a
commit
b90bcf3c11
@ -554,8 +554,11 @@ msgpack_unpacker_next_with_size(msgpack_unpacker* mpac,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = unpacker_next(mpac, result);
|
ret = unpacker_next(mpac, result);
|
||||||
if (ret == MSGPACK_UNPACK_SUCCESS) {
|
if (ret == MSGPACK_UNPACK_SUCCESS || ret == MSGPACK_UNPACK_CONTINUE) {
|
||||||
*p_bytes = mpac->parsed;
|
*p_bytes = mpac->parsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == MSGPACK_UNPACK_SUCCESS) {
|
||||||
msgpack_unpacker_reset(mpac);
|
msgpack_unpacker_reset(mpac);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user