quic: extract transport logic from Application to Session by pimterry · Pull Request #64127 · nodejs/node · GitHub
Skip to content

quic: extract transport logic from Application to Session#64127

Open
pimterry wants to merge 1 commit into
nodejs:mainfrom
pimterry:extract-h3-refactor
Open

quic: extract transport logic from Application to Session#64127
pimterry wants to merge 1 commit into
nodejs:mainfrom
pimterry:extract-h3-refactor

Conversation

@pimterry

Copy link
Copy Markdown
Member

Extracting out some standalone refactoring from #63995 for easier review while we keep debating the API. I think this is a helpful refactoring generally, but especially in a world where we're restructuring Application.

This shrinks the application layer by moving generic QUIC logic that will be used by all implementations into the Session itself, and makes the Session act as a clean interface over ngtcp2 - so that the Application exclusively uses Session methods for all connection manipulation, instead of managing ngtcp2 directly. This gives a cleaner split between the low-level QUIC behaviour and the per-application-protocol layer.

There's two small fixes notably included in the migration, contained within the moved code:

  • This fixes a SendPendingData bug where datagrams would stall and never send on an idle connection, in the nwrite == 0 branch.
  • We now check is_destroyed() after StreamCommit, since it calls JS callbacks which could destroy the session.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jun 25, 2026
Two small fixes notably included:

- Fixed a SendPendingData but where datagrams would stall on an idle
  connection in the nwrite == 0 branch.
- Check is_destroyed() after StreamCommit, since it calls JS callbacks
  which could destroy the session.

Signed-off-by: Tim Perry <pimterry@gmail.com>
@pimterry pimterry force-pushed the extract-h3-refactor branch from 19197f6 to 5fdb7e8 Compare June 25, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants