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

Fix duplicate header read in ConvertToJson in ext format #753

Merged
merged 1 commit into from Jan 1, 2020

Conversation

neuecc
Copy link
Member

@neuecc neuecc commented Jan 1, 2020

writer.WriteExtensionFormat(new ExtensionResult(47, new byte[] { 1, 10, 100 }));
writer.Flush();
// exception
var str = MessagePackSerializer.ConvertToJson(sequence.AsReadOnlySequence);

throws exception when call ConvertToJson when target block is ext format.

because it read extension header twice.

var header = reader.ReadExtensionFormatHeader();
var ext = reader.ReadExtensionFormat();

This PR fixed it and add tests.

@neuecc neuecc requested a review from AArnott January 1, 2020 06:40
Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. But since it fixes a 2.0 bug, shouldn't it target the v2.0 branch?

@AArnott AArnott added the bug label Jan 1, 2020
@neuecc neuecc changed the base branch from master to v2.0 January 1, 2020 06:54
@neuecc
Copy link
Member Author

neuecc commented Jan 1, 2020

surely.surely.
I've derived from 2.0 and force pushed.

@neuecc neuecc merged commit fb55814 into v2.0 Jan 1, 2020
@AArnott AArnott added this to the v2.0 milestone Jan 1, 2020
@AArnott AArnott deleted the fix-ext-converttojson branch January 1, 2020 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants