Skip to content

Store cid and token directly into frame#2043

Merged
tatsuhiro-t merged 1 commit intomainfrom
refactor-ncid
Mar 2, 2026
Merged

Store cid and token directly into frame#2043
tatsuhiro-t merged 1 commit intomainfrom
refactor-ncid

Conversation

@tatsuhiro-t
Copy link
Copy Markdown
Member

No description provided.

@tatsuhiro-t tatsuhiro-t added this to the v1.22.0 milestone Mar 1, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the conn_enqueue_new_connection_id function to enhance efficiency and robustness in managing new connection IDs. The primary change involves directly storing connection ID and stateless reset token data within the frame structure, thereby reducing temporary variable overhead. Additionally, the change introduces a more consistent error handling pattern to ensure resources are properly released upon failure.

Highlights

  • Direct Frame Population: Connection ID (CID) and Stateless Reset Token are now directly populated into the ngtcp2_new_connection_id frame structure, eliminating the need for intermediate local variables.
  • Reduced Variable Usage: Temporary local variables for ngtcp2_cid and ngtcp2_stateless_reset_token have been removed, simplifying the function's scope.
  • Improved Error Handling: A goto fail mechanism has been introduced to ensure proper deallocation of ngtcp2_frame_chain objects in case of errors during the connection ID enqueueing process.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lib/ngtcp2_conn.c
    • Removed local ngtcp2_cid and ngtcp2_stateless_reset_token variables.
    • Modified conn_call_get_new_connection_id to write directly into the ngtcp2_new_connection_id frame member.
    • Implemented a goto fail block for centralized error handling and resource cleanup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the conn_enqueue_new_connection_id function to store the new connection ID and token directly into the frame chain, which is a good simplification that avoids temporary variables. The introduction of a goto-based error handling pattern also improves the robustness of the function by ensuring proper resource cleanup on failure, fixing a potential issue in the previous implementation. I have one minor suggestion to improve code clarity.

@tatsuhiro-t tatsuhiro-t merged commit 34f8bab into main Mar 2, 2026
73 checks passed
@tatsuhiro-t tatsuhiro-t deleted the refactor-ncid branch March 2, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant