Skip to content

ftp conn reuse, tighten use_ssl check - #22823

Closed
icing wants to merge 2 commits into
curl:masterfrom
icing:ftp-conn-match-use_ssl
Closed

icing wants to merge 2 commits into
curl:masterfrom
icing:ftp-conn-match-use_ssl

Conversation

@icing

@icing icing commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CURLUSESSL_* needs a bit more special check on
connection reuse. Except CURLUSESSL_TRY, we
expect the reused connection to have exactly
the same setting. On TRY, we are happy with
anything that is no NONE.

CURLUSESSL_* needs a bit more special check on
connection reuse. Except CURLUSESSL_TRY, we
expect the reused connection to have exactly
the same setting. On TRY, we are happy with
anything that is no NONE.
@github-actions github-actions Bot added the FTP label Sep 4, 2026
@icing
icing requested a review from bagder September 4, 2026 09:19

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 new/changed reuse semantics for CURLUSESSL_* are not backed by targeted test coverage, making regressions in a subtle connection-reuse area more likely.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR tightens FTP-family connection reuse matching around CURLOPT_USE_SSL/use_ssl, ensuring reused connections have compatible TLS-upgrade intent: exact matches for all modes except CURLUSESSL_TRY, which can reuse any connection configured for some SSL use (non-NONE).

Changes:

  • Replace the prior use_ssl reuse assertion/ordering check with explicit matching rules.
  • Allow CURLUSESSL_TRY transfers to reuse any connection whose use_ssl is not CURLUSESSL_NONE; require exact equality for other modes.
File summaries
File Description
lib/ftp.c Updates FTP connection reuse matching logic for use_ssl to be stricter and explicit, with a special-case rule for CURLUSESSL_TRY.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/ftp.c
@bagder bagder closed this in c5f9b8b Sep 4, 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.

3 participants