Skip to content

remove unneeded NULL check in do_receive - #685

Merged
kazuho merged 1 commit into
masterfrom
kazuho/unneeded-NULL-check
Aug 20, 2026
Merged

remove unneeded NULL check in do_receive#685
kazuho merged 1 commit into
masterfrom
kazuho/unneeded-NULL-check

Conversation

@kazuho

@kazuho kazuho commented Aug 19, 2026

Copy link
Copy Markdown
Member

*space != NULL check is redundant with the current lifecycle.

space is assigned only after the corresponding PN space is confirmed non-null (lib/quicly.c:7546). Payload processing cannot discard the active space:

  • Handshake packets may discard the Initial space, not their own.
  • HANDSHAKE_DONE is 1-RTT and discards the Handshake space, not Application (lib/quicly.c:7008).
  • The active Initial or Handshake space is discarded only after record_receipt (lib/quicly.c:7705).
  • Application space is freed only when freeing the connection.

space is assigned only after the corresponding PN space is confirmed non-null (lib/quicly.c:7546). Payload processing cannot discard the active space:

- Handshake packets may discard the Initial space, not their own.
- HANDSHAKE_DONE is 1-RTT and discards the Handshake space, not Application (lib/quicly.c:7008).
- The active Initial or Handshake space is discarded only after record_receipt (lib/quicly.c:7705).
- Application space is freed only when freeing the connection.
@kazuho
kazuho merged commit c081f09 into master Aug 20, 2026
5 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.

2 participants