Skip to content

mod_lua: Close the connection after r:wsupgrade(), skip empty files in r:sendfile() - #1106

Merged
notroj merged 2 commits into
apache:trunkfrom
notroj:lua-ws-close
Nov 27, 2026
Merged

notroj merged 2 commits into
apache:trunkfrom
notroj:lua-ws-close

Conversation

@notroj

@notroj notroj commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Two follow-ups to #1022, needed before it can be backported: on 2.4.x, test_lua_001_06_unmasked_frame fails and test_lua_002_02_growth[sendfile] spins.

r:wsupgrade() now marks the connection for close once the 101 response has been sent, so it is closed whenever the script ends. Until now only r:wsclose() did that. Trunk's HTTP filters close the connection after a 101 anyway, but 2.4.x returns it to keepalive, where any further WebSocket frames would be read as an HTTP request.

r:sendfile() of an empty file now returns 0 without passing a brigade. The 2.4.x core output filter holds every zero-length file bucket until the end of the request and sets them all aside again on each call, so repeated calls get slower and slower.

Neither change is visible on trunk, so there is no new test and no changes entry; the existing test/modules/lua tests cover both once they reach 2.4.x.

🤖 Generated with Claude Code

notroj and others added 2 commits November 27, 2026 16:20
  connection after the request once upgraded.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
  empty file.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@notroj
notroj merged commit 20627d3 into apache:trunk Nov 27, 2026
45 of 46 checks passed
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.

1 participant