Skip to content

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

Merged
barchetta merged 1 commit into
helidon-io:helidon-4.1.xfrom
barchetta:4.1.3-9362-backport
Oct 14, 2024
Merged

4.1.3: Fix DataReader.findNewLine with multiple lone EOL character #9391
barchetta merged 1 commit into
helidon-io:helidon-4.1.xfrom
barchetta:4.1.3-9362-backport

Conversation

@barchetta

Copy link
Copy Markdown
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
@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