Skip to content

remove conn->given - #22875

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:rm-conn-given
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:rm-conn-given

Conversation

@icing

@icing icing commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The connectdata member given is always the same as conn->origin->scheme. It never changes. Remove that member and always use the origin scheme instead.

The `connectdata` member `given` is always the same as `conn->origin->scheme`.
It never changes. Remove that member and always use the origin scheme instead.

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.

🟢 Approval recommended

The refactor cleanly removes conn->given and all repository references were updated consistently without introducing new call sites or leaving stale usages.

Pull request overview

This PR removes the internal connectdata->given scheme pointer and consistently uses conn->origin->scheme as the “initial / requested” scheme, aligning the implementation with the invariant described in the PR metadata.

Changes:

  • Removed const struct Curl_scheme *given from struct connectdata.
  • Updated connection scheme setup to use conn->origin->scheme directly.
  • Replaced remaining conn->given references in reuse logging and HTTP/2 / HTTPSig authority handling with conn->origin->scheme.
File summaries
File Description
lib/urldata.h Removes the connectdata.given member from the connection struct.
lib/url.c Adjusts scheme selection and reuse logging to reference conn->origin->scheme instead of conn->given.
lib/http2.c Uses cf->conn->origin->scheme->defport for PUSH_PROMISE authority validation.
lib/http_httpsig.c Uses conn->origin->scheme->defport when forming the HTTPSig authority.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@bagder bagder closed this in 8903f4c Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants