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

Reset decoder before decoding in generated DictionaryDecoder #511

Open
0x26res opened this issue Jul 5, 2024 · 0 comments
Open

Reset decoder before decoding in generated DictionaryDecoder #511

0x26res opened this issue Jul 5, 2024 · 0 comments

Comments

@0x26res
Copy link

0x26res commented Jul 5, 2024

In the generated DictionaryDecoder, I've noticed that reset is called after the message is processed.

But if the acceptor or the decoder was to throw an exception, it will put the decoder in a bad state, the next time a same message comes in.

I think it should be reset before.

        else if (messageType == RejectDecoder.MESSAGE_TYPE)
        {
            reject.decode(buffer, offset, length);
            acceptor.onReject(reject);
            reject.reset();
        }
@0x26res 0x26res changed the title Reset dedoder before decoding in generated DictionaryDecoder Reset decoder before decoding in generated DictionaryDecoder Jul 23, 2024
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

No branches or pull requests

1 participant