mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-05 14:10:51 +02:00
cpp: fixes unpacker::next
This commit is contained in:
parent
2af7a7c6ac
commit
8783cf8ec3
@ -219,15 +219,22 @@ inline void unpacker::buffer_consumed(size_t size)
|
|||||||
inline bool unpacker::next(unpacked* result)
|
inline bool unpacker::next(unpacked* result)
|
||||||
{
|
{
|
||||||
int ret = msgpack_unpacker_execute(this);
|
int ret = msgpack_unpacker_execute(this);
|
||||||
|
|
||||||
if(ret < 0) {
|
if(ret < 0) {
|
||||||
throw unpack_error("parse error");
|
throw unpack_error("parse error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret == 0) {
|
||||||
|
result->zone().reset();
|
||||||
|
result->get() = object();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
} else {
|
||||||
result->zone().reset( release_zone() );
|
result->zone().reset( release_zone() );
|
||||||
result->get() = data();
|
result->get() = data();
|
||||||
reset();
|
reset();
|
||||||
|
return true;
|
||||||
return ret > 0;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user