Skip to content

connect timeout handling - #23558

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:connect-timeout-rework
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:connect-timeout-rework

Conversation

@icing

@icing icing commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Replace the timestamps and bools from ae993d2 with a single timediff_t. We have only one connect attempt ongoing and do not need the duplication as with shutdowns.

Preserve the connect timeout handling before a transfer reaches the DO phase, e.g. taking "protoconnect" phase into account.

Replace the timestamps and bools from ae993d2
with a single timediff_t. We have only one connect attempt ongoing and
do not need the duplication as with shutdowns.

Preserve the connect timeout handling before a transfer reaches
the DO phase, e.g. taking "protoconnect" phase into account.
@icing
icing requested a review from bagder October 22, 2026 12:44
@bagder
bagder requested a balanced review from Copilot October 22, 2026 14:59

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 focused refactor preserves pre-DO timeout handling and consistently initializes, uses, and clears connection timing state, with no unresolved findings.

No open issues 🎉

What changed in this PR

This PR simplifies connection timeout tracking to one elapsed-time offset per connection while preserving timeout enforcement through protocol negotiation before the DO phase.

Changes:

  • Replace per-socket timestamps and flags with a single connect_start_ms field.
  • Centralize timeout handling for ongoing connections, including FTP data connections.
  • Initialize and reset timing state during connection creation, successful connection, and filter cleanup.
File Description
lib/​urldata.h Replace per-socket timing state with one connection-start offset.
lib/​url.c Initialize the new timing field when allocating a connection.
lib/​connect.c Consolidate timeout calculations and reset timing after connection success.
lib/​conncache.c Reset timing when adding a connection to the pool.
lib/​cfilters.c Clear connection timing when discarding filters.

Review effort: Balanced

@bagder bagder closed this in eabeacb Oct 22, 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