Skip to content

macos: handle close during connect - #23510

Closed
icing wants to merge 4 commits into
curl:masterfrom
icing:macos-connect-early-close
Closed

icing wants to merge 4 commits into
curl:masterfrom
icing:macos-connect-early-close

Conversation

@icing

@icing icing commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

A combination of #23482 and #23445 with added test.

  • on macOS, do not treat select errors as definite
  • add debug env var to simulate a delay after opening a connection socket, so the test server has time to accept, send data and close before curl continues
  • add test_05_11 as reproducer

A combination of curl#23482 and curl#23445 with added test.

- on macOS, do not treat select errors are definite
- add debug env var to simulate a delay after opening
  a connection socket, so the test server has time
  to accept, send data and close before curl continues
- add test_05_11 as reproducer
@github-actions github-actions Bot added the tests label Oct 20, 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

The debug delay runs before connect(), leaving the regression test’s required timing unreliable.

1 open issue
What changed in this PR

Addresses macOS connection failures when a server sends a response and closes before curl checks connect completion.

Changes:

  • Verifies socket errors on macOS before declaring connection failure.
  • Adds a debug delay setting and an early-close regression test.
File Description
tests/​http/​test_05_errors.py Adds an early-response server and regression test.
lib/​cf-socket.c Updates connect verification and adds the debug delay.
docs/​libcurl/​libcurl-env-dbg.md Documents the debug delay setting.

Review effort: Balanced

Comment thread lib/cf-socket.c Resolved
- move wait after first connect() call
- rename var to `CURL_DBG_SOCK_CONNECT_WAIT_MS`
@curl curl deleted a comment from testclutch Oct 21, 2026
@bagder bagder closed this in 2afc2a4 Oct 22, 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.

2 participants