Skip to content

cf-socket: disable TCP SYN retransmissions for localhost on Windows - #22494

Closed
bagder wants to merge 6 commits into
masterfrom
bagder/win-no-syn-retrans
Closed

bagder wants to merge 6 commits into
masterfrom
bagder/win-no-syn-retrans

Conversation

@bagder

@bagder bagder commented Aug 5, 2026

Copy link
Copy Markdown
Member

Suggested-by: Marcel Jamin
URL: https://curl.se/mail/lib-2026-08/0002.html

@github-actions github-actions Bot added the CI Continuous Integration label Aug 5, 2026
@bagder
bagder force-pushed the bagder/win-no-syn-retrans branch from d88364c to 0986092 Compare August 5, 2026 13:31
@bagder
bagder marked this pull request as ready for review August 5, 2026 13:33
@bagder
bagder requested a lite review from Copilot August 5, 2026 13:33

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.

Pull request overview

This PR adjusts Windows socket behavior for localhost connections by disabling TCP SYN retransmissions, aiming to fail faster when localhost targets are unreachable.

Changes:

  • Include Windows TCP RTO definitions via mstcpip.h and add a Windows-only WSAIoctl(SIO_TCP_INITIAL_RTO) call for localhost targets.
  • Add a typos configuration exception for rto/RTO identifiers used by the new code.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/cf-socket.c Adds Windows-only logic to disable SYN retransmissions for localhost connects via SIO_TCP_INITIAL_RTO.
.github/scripts/typos.toml Adds rto/RTO to typos ignore list to avoid false positives.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/cf-socket.c Outdated
Comment thread lib/cf-socket.c Outdated
Comment thread lib/cf-socket.c Outdated
Comment thread lib/cf-socket.c Outdated
bagder and others added 2 commits August 5, 2026 22:22
Viktor's proposals

Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
@bagder

bagder commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Marcel Jamin confirmed privately to me that this PR seems to make failed connect attempts to local host fail much faster.

@bagder bagder closed this in abcb534 Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration connecting & proxies Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

3 participants