Skip to content

Use unsigned bytes in the HTTP parser - #230

Merged
rafaelfranca merged 1 commit into
masterfrom
ci-fixes/parser-bytes
Nov 18, 2026
Merged

rafaelfranca merged 1 commit into
masterfrom
ci-fixes/parser-bytes

Conversation

@rafaelfranca

@rafaelfranca rafaelfranca commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Problem

The parser in 0.18.3 was generated on a platform with unsigned char.
On x86-64 Linux, the compiler uses signed char.
The parser can reject bytes 0x80 through 0xff in request headers and raw request targets.

PR #229 regenerated the C parser on x86-64.
The Ragel output still depends on the platform's default char type.

Solution

Set the Ragel alphabet and key to unsigned char.
Regenerate the C parser and add tests for non-ASCII request bytes.

Verification

Version 0.18.3 included a parser generated on a platform with unsigned char. On x86-64, that parser can reject request bytes above 0x7f.

Master now has parser output generated on x86-64. Ragel still uses the default signedness of char, so its output can differ between platforms.

Set the Ragel alphabet and key to unsigned char. Regenerate the parser and add tests for non-ASCII request bytes.
@rafaelfranca

Copy link
Copy Markdown
Member Author

@byroot I think this fixes the issue with the ragel differences between machines

@byroot

byroot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Nice find.

@rafaelfranca
rafaelfranca marked this pull request as ready for review November 18, 2026 23:11
@rafaelfranca
rafaelfranca merged commit 8de6572 into master Nov 18, 2026
10 of 13 checks passed
@rafaelfranca
rafaelfranca deleted the ci-fixes/parser-bytes branch November 18, 2026 23:11
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