Skip to content

fix: guard engine callbacks after QuicContext shutdown#82

Merged
richard-ramos merged 1 commit into
mainfrom
engine-callback
Apr 20, 2026
Merged

fix: guard engine callbacks after QuicContext shutdown#82
richard-ramos merged 1 commit into
mainfrom
engine-callback

Conversation

@richard-ramos

Copy link
Copy Markdown
Member

No description provided.

@richard-ramos
richard-ramos requested a review from a team as a code owner April 17, 2026 20:53
@richard-ramos
richard-ramos requested review from Copilot, gmelodie and vladopajic and removed request for a team April 17, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the QUIC context lifecycle by adding defensive guards to prevent lsquic engine callbacks from running after a QuicContext has been shut down, reducing the chance of use-after-free / nil dereference crashes during teardown.

Changes:

  • Add early-return guards in packet receive and engine processing paths when ctx or ctx.engine is nil.
  • Add shutdown guards to connection operations (processWhenReady, close, abort, makeStream) to avoid invoking lsquic on a destroyed engine.
  • Bump package version to 0.1.1.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lsquic/context/io.nim Prevents packet ingestion after context/engine shutdown.
lsquic/context/context.nim Adds shutdown guards around engine processing and connection/stream operations.
lsquic.nimble Version bump for the bugfix release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lsquic/context/context.nim
@richard-ramos
richard-ramos merged commit 8dfa9af into main Apr 20, 2026
20 checks passed
@richard-ramos
richard-ramos deleted the engine-callback branch April 23, 2026 12:38
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.

4 participants