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

4.1.3: Fix DataReader.findNewLine with multiple lone EOL character #9391

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

barchetta
Copy link
Member

Backport #9362 to Helidon 4.1.3

Description

DataReader.findNewLine returns max instead of new line index when there are multiple lone CR characters in the same buffer.

E.g. \r\r\r\n

The virtual index is incorrectly accumulated each time with the relative index, its value may exceed max which will skip any valid CRLN within max.

  • Fix virtual index accumulation
  • Re-use the branch that changes the buffer
  • Add unit tests

Fixes #9365

Documentation

None.

…io#9362)

When there is multiple lone CR within a buffer, the virtual index is accumulated each time with the node index.
The virtual index may be incorrectly seen as >= max, which ignores CRLN within max.

- Fix virtual index accumulation
- Re-use the branch that changes the buffer
- Renamed indexWithinNode -> fromIndexNode
- Renamed crIndex -> crIndexNode
- Renamed lfIndex -> lfIndexNode
- Add unit tests
@barchetta barchetta added webserver backport Issues that are merged into a single branch, but missing in either master or previous release 4.x Version 4.x labels Oct 14, 2024
@barchetta barchetta added this to the 4.1.3 milestone Oct 14, 2024
@barchetta barchetta self-assigned this Oct 14, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 14, 2024
@barchetta barchetta mentioned this pull request Oct 14, 2024
16 tasks
@barchetta barchetta merged commit 0985795 into helidon-io:helidon-4.1.x Oct 14, 2024
44 checks passed
@barchetta barchetta deleted the 4.1.3-9362-backport branch January 3, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x backport Issues that are merged into a single branch, but missing in either master or previous release OCA Verified All contributors have signed the Oracle Contributor Agreement. webserver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants