Skip to content

multihandle, some shrinks - #22801

Closed
icing wants to merge 6 commits into
curl:masterfrom
icing:multi-easy-shrinks
Closed

icing wants to merge 6 commits into
curl:masterfrom
icing:multi-easy-shrinks

Conversation

@icing

@icing icing commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
  • new struct Curl_fixed_buf keeping data and length in one alloc for upload/download/socket buffers held in the multi
  • max_host_connections changed to uint32_t
  • max_total_connections changed to uint32_t
  • maxconnects changed to uint32_t
  • last_timeout_ms changed to timediff_t
  • now_access_count removed, no one used it

@icing
icing requested a review from bagder September 2, 2026 13:45

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.

🟡 Changes recommended

It changes documented stream-limit behavior and introduces an allocation-size overflow path.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Refactors multi-handle storage to reduce its footprint and use fixed-width limit types.

Changes:

  • Co-locates transfer-buffer metadata and data in single allocations.
  • Converts connection limits and timeout fields to narrower or appropriate types.
  • Safely caps HTTP/3 concurrency when converting to int.
File summaries
File Description
lib/vquic/cf-ngtcp2.c Caps stream concurrency at INT_MAX.
lib/url.c Updates connection-limit formatting.
lib/multiif.h Changes concurrency accessor type.
lib/multihandle.h Shrinks and reorganizes multi-handle fields.
lib/multi.c Updates option handling and buffer allocation.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

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

Comment thread lib/multi.c Outdated
Comment thread lib/multi.c Outdated
@icing
icing force-pushed the multi-easy-shrinks branch from ddad25d to cebe440 Compare September 3, 2026 07:57
- new `struct Curl_fixed_buf` keeping data and length in one alloc
  for upload/download/socket buffers held in the multi
- max_host_connections changed to uint32_t
- max_total_connections changed to uint32_t
- maxconnects changed to uint32_t
- last_timeout_ms changed to timediff_t
- now_access_count removed, no one used it
- CURLMOPT_MAX_CONCURRENT_STREAMS: set to 100 for values > INT_MAX,
  just as before
- add function to allocate `struct Curl_fixed_buf`, checking overflow
  an very large buffer requests.
@icing
icing force-pushed the multi-easy-shrinks branch from cebe440 to 02ecd75 Compare September 3, 2026 08:04
@icing
icing requested a review from bagder September 3, 2026 08:28
@bagder bagder closed this in 38703fe Sep 3, 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.

3 participants