Skip to content

unix-sockets: ignore proxy settings#21630

Closed
icing wants to merge 2 commits into
curl:masterfrom
icing:uds-proxy-ignore-fix
Closed

unix-sockets: ignore proxy settings#21630
icing wants to merge 2 commits into
curl:masterfrom
icing:uds-proxy-ignore-fix

Conversation

@icing
Copy link
Copy Markdown
Contributor

@icing icing commented May 15, 2026

Fix a recent regression: when a unix-socket is configured, all proxy settings must be ignored. The via_peer had been checked correctly, but the connections proxy bits were not cleared.

Add test_11_04 to verify.

Reported-by: Fabian Keil (libcurl mailing list)

Fix a recent regression: when a unix-socket is configured, all proxy
settings must be ignored. The `via_peer` had been checked correctly,
but the connections proxy bits were not cleared.

Add test_11_04 to verify.

Reported-by: Fabian Keil (libcurl mailing list)
@github-actions github-actions Bot added the tests label May 15, 2026
@icing icing requested a review from bagder May 15, 2026 13:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression where unix-socket usage was not fully ignoring proxy settings: while via_peer was checked, the connection's proxy bits (socksproxy, httpproxy, proxy) remained set, leading to incorrect behavior. The fix explicitly clears those bits when a unix-socket peer is configured, and adjusts the host-displayname macro to key off peer pointers rather than the proxy bits. A new test verifies that proxy args are ignored under --unix-socket.

Changes:

  • Clear bits.socksproxy/httpproxy/proxy when via_peer->unix_socket is set; skip proxy initialization in that case.
  • Update CURL_CONN_HOST_DISPNAME to test for the existence of socks_proxy.peer/http_proxy.peer instead of the proxy bits.
  • Add test_11_04_unix_connect_http to ensure proxy args are ignored when using a unix socket.

Reviewed changes

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

File Description
lib/url.c Explicitly disable proxy bits on connectdata when going via a unix-socket peer.
lib/urldata.h Switch CURL_CONN_HOST_DISPNAME to peer-pointer checks consistent with cleared proxy bits.
tests/http/test_11_unix.py New test verifying http downloads via unix socket ignore proxy arguments.

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

@bagder bagder closed this in ad549c4 May 16, 2026
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Fix a recent regression: when a unix-socket is configured, all proxy
settings must be ignored. The `via_peer` had been checked correctly,
but the connections proxy bits were not cleared.

Add test_11_04 to verify.

Reported-by: Fabian Keil (libcurl mailing list)
Closes curl#21630
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