Skip to content

connectdata: use less curltime - #22815

Closed
icing wants to merge 3 commits into
curl:masterfrom
icing:connectdata-timestamps
Closed

icing wants to merge 3 commits into
curl:masterfrom
icing:connectdata-timestamps

Conversation

@icing

@icing icing commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Replace several curltime members with timediff_t in connectdata.

Everyone needs a shrink!

Replace several curltime members with timediff_t in connectdata.

Everyone needs a shrink!
@github-actions github-actions Bot added the tests label Sep 3, 2026

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

Two moderate timing issues must be resolved before approval.

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

Pull request overview

Reduces connectdata memory usage by storing several timestamps as millisecond offsets from connection creation.

Changes:

  • Converts idle, upkeep, health-check, and shutdown timestamps to timediff_t.
  • Reworks timestamp calculations and updates shutdown tests.
File summaries
File Review
tests/unit/unit2606.c Updates shutdown-state test fixtures.
lib/urldata.h Defines offset-based timestamp fields.
lib/url.c Has a moderate queue-time regression caused by reusing an earlier mutable timestamp.
lib/connect.c Has a moderate shutdown-state issue where zero aliases the “not started” sentinel.
lib/conncache.c Converts connection-pool timing calculations.
lib/cfilters.c Clears offset-based shutdown state.
Review details
  • Files reviewed: 6/6 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/connect.c
Comment on lines +124 to +125
conn->shutdown.start_ms[sockindex] =
curlx_ptimediff_ms(pnow, &conn->created);
Comment thread lib/url.c Outdated
@icing
icing requested a review from bagder September 3, 2026 09:44
This is closer to how the timer is documented.
@bagder bagder closed this in 52ec4a9 Sep 3, 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