Skip to content

connection shutdown, cleanup code - #22888

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:cshutdn-moves
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:cshutdn-moves

Conversation

@icing

@icing icing commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Move all shutdown related functions to cshutdn.c and give them Curl_cshutdn_* prefix.

Add connection age handling methods to conncache.h, so that other code does not need to mess with details of how connections keep time.

Move all shutdown related functions to cshutdn.c and give
them `Curl_cshutdn_*` prefix.

Add connection age handling methods to conncache.h, so that
other code does not need to mess with details of how connections
keep time.
@icing
icing requested a review from bagder September 9, 2026 13:27
@bagder
bagder requested a balanced review from Copilot September 9, 2026 21:12

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 relocation and API updates are complete and preserve the existing shutdown and connection-timing behavior.

Pull request overview

Centralizes connection shutdown logic and encapsulates connection-age bookkeeping.

Changes:

  • Moves shutdown APIs into cshutdn with consistent naming.
  • Adds connection timestamp helpers to the connection pool.
  • Updates callers, including Telnet timeout handling.
File summaries
File Description
lib/cshutdn.c Implements centralized shutdown operations.
lib/cshutdn.h Declares the renamed shutdown APIs.
lib/cfilters.c Uses centralized shutdown-state checks.
lib/cfilters.h Removes the relocated shutdown declaration.
lib/conncache.c Manages connection timestamps and shutdown calls.
lib/conncache.h Exposes connection-age helper APIs.
lib/connect.c Uses the new shutdown and usage APIs.
lib/connect.h Removes relocated shutdown APIs.
lib/telnet.c Uses the standard transfer timeout calculation.
lib/transfer.c Uses centralized shutdown operations.
lib/url.c Initializes timestamps through the connection pool.
lib/vdns/hostip.c Uses the connection-age abstraction.
lib/vtls/vtls.c Uses renamed shutdown timer APIs.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 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 6ee61c3 Sep 9, 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