Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep consistent read size after closing MessageUnpacker #621

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

okumin
Copy link
Contributor

@okumin okumin commented Jan 18, 2022

I found MessageUnpacker#getTotalReadBytes doesn't return correct size once I invoke MessageUnpacker#close.

That's because MessageUnpacker#close drops the current buffer without updating the read size
https://github.com/msgpack/msgpack-java/blob/v0.9.0/msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java#L1738-L1740

even though MessageUnpacker#getTotalReadBytes requires the size of the latest buffer.
https://github.com/msgpack/msgpack-java/blob/v0.9.0/msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java#L261

@komamitsu
Copy link
Member

@xerial ^ What do you think?

@yuokada
Copy link

yuokada commented Feb 4, 2022

@komamitsu It's good to ping him via slack or twitter. IIRC, he doesn't watch notifications from github.

@xerial
Copy link
Member

xerial commented Mar 7, 2022

Thanks for the fix. Yeah. position value needs to be reflected to the total read size before resetting to 0

@xerial xerial merged commit ceffe07 into msgpack:develop Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants