Skip to content

bugfix: avoid truncating Lua context in filters#2512

Merged
zhuizhuhaomeng merged 1 commit into
openresty:masterfrom
HanadaLee:fixed_context
Jun 28, 2026
Merged

bugfix: avoid truncating Lua context in filters#2512
zhuizhuhaomeng merged 1 commit into
openresty:masterfrom
HanadaLee:fixed_context

Conversation

@HanadaLee

Copy link
Copy Markdown
Contributor

The request context was widened from uint16_t to uint32_t when phase flags grew beyond 16 bits, but the header and body filters continued saving it in a uint16_t old_context variable.

Contexts above 0xffff were truncated while running a filter and restored as zero afterward. Use uint32_t for old_context to preserve the complete phase value.

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

The request context was widened from uint16_t to uint32_t when phase
flags grew beyond 16 bits, but the header and body filters continued
saving it in a uint16_t old_context variable.

Contexts above 0xffff were truncated while running a filter and
restored as zero afterward. Use uint32_t for old_context to preserve
the complete phase value.
@zhuizhuhaomeng zhuizhuhaomeng merged commit 4070709 into openresty:master Jun 28, 2026
3 of 7 checks passed
@HanadaLee HanadaLee deleted the fixed_context branch June 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants