Skip to content

http2: use stream in userdata - #23262

Closed
icing wants to merge 4 commits into
curl:masterfrom
icing:h2-stream-userdata-change
Closed

icing wants to merge 4 commits into
curl:masterfrom
icing:h2-stream-userdata-change

Conversation

@icing

@icing icing commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Change nghttp2 stream userdata from the transfer to the h2_stream_ctx and lookup the transfer at the multi's table. This replaces hash lookups with table lookups which are faster.

@icing
icing requested a review from bagder October 5, 2026 11:41
@icing icing added the HTTP/2 label Oct 5, 2026
@bagder
bagder requested a balanced review from Copilot October 5, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The decoder signature remains incompatible with the quiche caller on platforms where int32_t is not int.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Moves HTTP/2 stream userdata from easy handles to stream contexts, enabling faster multi-table transfer lookup.

Changes:

  • Stores transfer IDs in HTTP/2 stream contexts.
  • Updates nghttp2 callbacks to resolve transfers through the multi table.
  • Standardizes HTTP status storage to int32_t.
File Description
lib/​http2.c Refactors stream userdata and callback lookup.
lib/​http.h Changes status decoder parameter type.
lib/​http.c Updates status decoder implementation.
lib/​cf-h2-proxy.c Aligns proxy status type.
lib/​vquic/​cf-ngtcp2-cmn.h Aligns HTTP/3 status type.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/http.h

/* Decode HTTP status code string. */
CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len);
CURLcode Curl_http_decode_status(int32_t *pstatus, const char *s, size_t len);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ack

icing added 4 commits October 5, 2026 16:09
Change nghttp2 stream userdata from the transfer to the `h2_stream_ctx`
and lookup the transfer at the multi's table. This replaces hash lookups
with table lookups which are faster.
@icing
icing force-pushed the h2-stream-userdata-change branch from 8f6db72 to 6ca3ea1 Compare October 5, 2026 14:10
@icing
icing requested a review from bagder October 5, 2026 14:27
@bagder bagder closed this in d929543 Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants