urldata cleanups - #22604
Closed
icing wants to merge 2 commits into
Closed
urldata cleanups#22604icing wants to merge 2 commits into
icing wants to merge 2 commits into
Conversation
- sockindex: int -> int8_t - move connectdata members around for fun and profit - remove data->state.current_speed as unused - remove data->state.trailers_bytes_sent as unsed - remove data->state.trailers_buf as unsed The sockindex type change spread a little.
bagder
reviewed
Aug 17, 2026
There was a problem hiding this comment.
Pull request overview
This PR performs internal urldata/connection housekeeping by shrinking the socket-index type to int8_t, reorganizing connectdata/UrlState members, and removing a few unused UrlState fields. It also updates several call sites and logging to align with these internal structure changes.
Changes:
- Change many internal APIs and struct members from
inttoint8_tforsockindex/ send+recv indices. - Reorder
struct connectdataandstruct UrlStatemembers; replacekeepalivetracking withlastupkeepand extend timestamp bookkeeping. - Remove unused
data->state.current_speed,data->state.trailers_bytes_sent, anddata->state.trailers_buf, plus related initializations.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/ws.c | Header comment edit (currently introduces a broken URL). |
| lib/vtls/vtls.h | Update internal TLS function prototypes to int8_t sockindex. |
| lib/vtls/vtls.c | Adjust TLS implementation signatures to int8_t sockindex. |
| lib/vtls/vtls_int.h | Update vtls internal function pointer/prototypes to int8_t sockindex. |
| lib/vtls/openssl.c | Update OpenSSL vtls callback signature to int8_t sockindex. |
| lib/vssh/libssh2.c | Use int8_t sockindex from Curl_conn_sockindex(). |
| lib/vssh/libssh.c | Update internal SSH helpers to int8_t sockindex. |
| lib/vdns/cf-dns.h | Update DNS cfilter APIs to int8_t sockindex. |
| lib/vdns/cf-dns.c | Update DNS cfilter implementation signatures/usages to int8_t sockindex. |
| lib/urldata.h | Reorder connectdata/UrlState; change send/recv typedefs and indices to int8_t; remove unused UrlState trailer fields. |
| lib/url.c | Remove state.current_speed init; adjust conn init timestamps; use int8_t loop index for cfilter cleanup. |
| lib/transfer.h | Update transfer setup APIs to int8_t sockindex. |
| lib/transfer.c | Update transfer setup implementation to int8_t send/recv indices. |
| lib/pingpong.h | Update pingpong read response API to int8_t sockindex. |
| lib/pingpong.c | Update pingpong read implementation signature to int8_t sockindex. |
| lib/openldap.c | Update LDAP recv callback signature to int8_t sockindex. |
| lib/multi.c | Update connection completion logging to include host+port (currently with a varargs type mismatch). |
| lib/http2.h | Update HTTP/2 upgrade API to int8_t sockindex. |
| lib/http2.c | Update HTTP/2 filter/upgrade implementation signatures to int8_t sockindex. |
| lib/ftp.c | Update FTP read-response signature to int8_t sockindex. |
| lib/easy.c | Adjust curl_easy_reset() state initialization to match removed fields/order. |
| lib/connect.h | Update connection/shutdown/origin APIs to int8_t sockindex. |
| lib/connect.c | Update connection/shutdown/origin implementations to int8_t sockindex; update upkeep timestamp field used. |
| lib/conncache.c | Update idle/health/upkeep timestamp tracking (lastchecked, lastupkeep, lastused). |
| lib/cfilters.h | Update cfilter API surface (sockindex types, Curl_conn_sockindex() return type). |
| lib/cfilters.c | Update cfilter implementations to use int8_t sockindex. |
| lib/cf-socket.h | Update socket cfilter APIs to int8_t sockindex. |
| lib/cf-socket.c | Update socket cfilter implementations to int8_t sockindex. |
| lib/cf-setup.h | Update setup cfilter API to int8_t sockindex. |
| lib/cf-setup.c | Update setup cfilter implementations to int8_t sockindex. |
| lib/cf-recvbuf.h | Update recvbuf cfilter API to int8_t sockindex. |
| lib/cf-recvbuf.c | Update recvbuf cfilter implementations to int8_t sockindex. |
| lib/cf-https-connect.h | Update HTTPS-CONNECT cfilter API to int8_t sockindex. |
| lib/cf-https-connect.c | Update HTTPS-CONNECT cfilter implementations to int8_t sockindex. |
Suppressed comments (2)
lib/multi.c:665
- This printf-style call uses "%u" but passes conn->origin->port (uint16_t), which is promoted to int in varargs on typical platforms. That type mismatch is undefined behavior. Cast the port to unsigned int (or adjust the format) before passing it.
conn->origin->user_hostname, conn->origin->port);
lib/multi.c:675
- This printf-style call uses "%u" but passes conn->origin->port (uint16_t), which is promoted to int in varargs on typical platforms. That type mismatch is undefined behavior. Cast the port to unsigned int (or adjust the format) before passing it.
conn->origin->port);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
(I need a cat this this excuse to work)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The sockindex type change spread a little.