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

Decoder Improvements #43

Merged
merged 4 commits into from
Jun 25, 2024
Merged

Decoder Improvements #43

merged 4 commits into from
Jun 25, 2024

Conversation

felixwrt
Copy link
Owner

@felixwrt felixwrt commented Jun 25, 2024

Up until now, the Decoder was writing some data (escape sequence bytes, padding bytes) into the Buffer even though that data isn't always part of the user data. This lead to situations where a decoded message that would barely fit into the buffer couldn't be decoded because writing these additional (unneeded) bytes into the buffer failed.

With this PR, the decoder's state handling is adapted such that it only writes data into the buffer when that data belongs to the decoded message. The decoder doesn't use truncate anymore to remove written bytes from the buffer.

Breaking Changes

This PR adds a new member invalid_padding_bytes to the enum variant DecodeErr::InvalidMessage which indicates if any of the padding bytes were invalid (!=0).

felixwrt added 3 commits June 25, 2024 21:08
This change adds a zero_cache counter to the Decoder's state. The implementation uses this cache so that padding bytes aren't pushed into the buffer and need to be removed later.
@felixwrt felixwrt merged commit 8200fd2 into main Jun 25, 2024
18 checks passed
@felixwrt felixwrt deleted the decoder_v2_3 branch June 25, 2024 19:48
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.

1 participant