Skip to content

fix: stream creation when connections are nil#63

Merged
richard-ramos merged 1 commit intomainfrom
fix-stream-conn-nil
Feb 17, 2026
Merged

fix: stream creation when connections are nil#63
richard-ramos merged 1 commit intomainfrom
fix-stream-conn-nil

Conversation

@richard-ramos
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 17, 2026 16:04
@richard-ramos richard-ramos requested a review from a team as a code owner February 17, 2026 16:04
@richard-ramos richard-ramos requested review from gmelodie and vladopajic and removed request for a team February 17, 2026 16:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a race condition in stream creation by ensuring proper nil checks when a connection is closed. The fix addresses a scenario where makeStream could be called on a connection that has been closed but not yet fully cleaned up, preventing potential crashes or undefined behavior.

Changes:

  • Set lsquicConn to nil in connection close callbacks to mark the underlying connection as invalid
  • Add nil checks in makeStream to raise ConnectionClosedError when attempting to create a stream on a closed connection
  • Update makeStream signature to properly declare it raises ConnectionClosedError

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lsquic/context/server.nim Set lsquicConn to nil in server's onConnClosed callback
lsquic/context/client.nim Set lsquicConn to nil in client's onConnClosed callback
lsquic/context/context.nim Add nil checks and error handling in makeStream procedure

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

@richard-ramos richard-ramos merged commit 6ae249c into main Feb 17, 2026
22 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.

4 participants