Repository navigation
lib: Add recv_stop_sending callback - #2210
Conversation
This is a new optional callback that fires when a remote STOP_SENDING frame is received. Until now, the only way to observe this was detecting the SHUT_WR error on the next write - which would never happen for streams blocked by flow control.
There was a problem hiding this comment.
Code Review
This pull request introduces a new callback, recv_stop_sending, which is triggered when a STOP_SENDING frame is received from a remote endpoint. To support this, the callback version has been bumped to NGTCP2_CALLBACKS_V4, and the ngtcp2_callbacks struct has been updated. The implementation includes helper functions to invoke the callback and comprehensive unit tests to verify its behavior under various conditions, such as duplicate frames and non-existent streams. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Thank you for PR. Merged now. |
This adds a new optional callback, which fires when a remote STOP_SENDING frame is received.
Until now, the only way to observe this was detecting the SHUT_WR error on the next write. That's a bit limiting in itself, but also may never happen for streams that are blocked by flow control, if the application deschedules them and waits for extend_max_stream_data to resume writing. With this callback it's easy for applications to clean up stopped streams immediately instead.
I've tried to mirror the equivalent callback for received RESET_STREAM here. This is my first contribution to ngtcp2 directly, and this is a bit outside my normal area, so do let me know if I've missed something in the process here.