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

Ft improve payload parsing #55

Conversation

biryukovmaxim
Copy link
Contributor

Upgraded Packet Reader to correctly calculate the packet length when handling Unicode characters. This change was necessary because the previous design would incorrectly size Unicode characters as single bytes. Additional dependency unicode-segmentation was introduced to use Unicode segmentation algorithm for correct grapheme counting.

Updated tests to verify the new implementation and made modifications in Cargo.toml and Cargo.lock accordingly. Featured 'v4' and 'v3' were updated to depend on 'unicode-segmentation.'

It still needed to be refactored, but at least it works somehow

Upgraded Packet Reader to correctly calculate the packet length when handling Unicode characters. This change was necessary because the previous design would incorrectly size Unicode characters as single bytes. Additional dependency `unicode-segmentation` was introduced to use Unicode segmentation algorithm for correct grapheme counting.

Updated tests to verify the new implementation and made modifications in Cargo.toml and Cargo.lock accordingly. Featured 'v4' and 'v3' were updated to depend on 'unicode-segmentation.'

This change improves system's ability to correctly handle Unicode.
In the Cargo.toml file, 'unicode-segmentation' has been removed from the v4 feature. Previously, both v3 and v4 features had 'unicode-segmentation', which was unnecessary duplication. Now, 'unicode-segmentation' is only included in the v3 feature, ensuring a cleaner and more efficient configuration.
@biryukovmaxim biryukovmaxim mentioned this pull request Jul 6, 2023
4 tasks
@biryukovmaxim biryukovmaxim marked this pull request as draft July 6, 2023 18:19
Modified byte reading code to consume all available data if no separator was identified. Also, updated the test data in 'test_payload_stream_v3' to adjust for the changed reading of bytes. This ensures the payload stream processes all data and the tests reflect the appropriate changes.
@biryukovmaxim biryukovmaxim marked this pull request as ready for review July 7, 2023 17:59
@Totodore Totodore merged commit 37b5b66 into Totodore:ft-improve-payload-parsing Jul 20, 2023
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