Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes three robustness issues in the HTTP/3 (ngtcp2/nghttp3) path:
Stream leak on submit failure
After successfully opening a QUIC bidi stream, if nghttp3_conn_submit_request() fails, the code left the QUIC stream open. We now call cf_ngtcp2_stream_close() to cancel the just-opened stream and flush egress, preventing a leaked stream on the wire. Note: used_bidi_streams remains monotonic by design and is not decremented.
Incorrect stream marked as QUIC-flow-blocked
When ngtcp2_conn_writev_stream() returns NGTCP2_ERR_STREAM_DATA_BLOCKED, the code previously marked quic_flow_blocked on the transfer associated with x->data, which may not correspond to stream_id. We now look up the correct Curl_easy via ngtcp2_conn_get_stream_user_data(stream_id), mark that stream’s context, and nudge the multi with Curl_multi_mark_dirty().
Undefined error returned from nghttp3 callback
cb_h3_recv_header() returned -1 on errors, which is not a defined nghttp3 error code. We now return NGHTTP3_ERR_CALLBACK_FAILURE so nghttp3 can correctly classify and handle the failure.
Note: These patches were created with LLMs.