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

[ch83910] Rewrite decoder to fix some decoding bugs #3

Merged
merged 17 commits into from
Sep 3, 2020

Conversation

samstokes
Copy link
Contributor

This fixes a few bugs and places we weren't quite compliant with the spec:

  • the handling for lines split across chunks wasn't quite right and could drop lines if that happened more than once in a stream.
  • we were stripping all leading spaces from field values, instead of just the first leading space.
  • multiple values for the same field would overwrite (now they concatenate instead)
  • a line without a colon was treated as an error (now it treats the whole line as the field name, with an empty field value)

Closes #2 (includes commits from that PR, which included tests that discovered some of these bugs).

@samstokes samstokes merged commit c420b50 into master Sep 3, 2020
@samstokes samstokes deleted the samstokes/ch83910/fix-whitespace-split branch September 3, 2020 23:55
samstokes added a commit that referenced this pull request Mar 8, 2021
Rewrite the SSE decoder again to fix a nasty bug that seemed to be occurring intermittently during IH tests (and in any case was reproducible). If two events occurred within a single chunk, we would drop one, which is unfortunate. This may have been introduced during the last rewrite (#3).

I also tried hard to simplify down the logic and remove some conditionals that didn't need to be there, so hopefully the result is a little more readable than what came before.
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.

2 participants