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 opensearch codec bug #1362

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

conorbros
Copy link
Member

This path was never being run and I didn't notice the error until a large enough message went through.

The match std::mem::replace(&mut self.state, State::ParsingResponse) part is a bit misleading, it replaces self.state with State::ParsingResponse and returns what was there before, we want to set it back to State::ReadingBody if there is still more body to read. i.e. if src.len() < content_length

Copy link
Member

@rukai rukai left a comment

Choose a reason for hiding this comment

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

ah yep, that mem::replace makes correctness hard, the fix seems reasonable to me.

@conorbros conorbros enabled auto-merge (squash) October 30, 2023 06:28
@conorbros conorbros merged commit 606fbfc into shotover:main Oct 30, 2023
39 checks passed
@conorbros conorbros deleted the opensearch-codec-bug-ifix branch October 30, 2023 12:29
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.

3 participants