← Commit list

c5f9b8b405

Stefan Eissing
Stefan Eissing
2026-09-04
SUCCESS Duration: 429s

Subject

ftp: tighten use_ssl check for conn reuse

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/ftp.c+8 -9
@@ -4479,16 +4479,15 @@ bool Curl_ftp_conns_match(struct connectdata *needle, struct connectdata *conn)
cftpc->alternative_to_user) ||
(nftpc->ccc != cftpc->ccc))
return FALSE;
- /* A mismatch on `use_ssl` MUST have been found in connection matching
- * before we come here. This is a check on MAYBE/MUST use of STARTTLS and
- * it only works on FTP. But IMAP/SMTP etc have the same `use_ssl` and
- * no extra match like FTP. We lack tests in this area, so let FTP fail
- * loudly here to help other cases. */
- if(nftpc->use_ssl > cftpc->use_ssl) {
- DEBUGASSERT(0);
- return FALSE;
+
+ switch(nftpc->use_ssl) {
+ case CURLUSESSL_TRY:
+ /* A transfer that only "tries" SSL, is compatible with a connection
+ * of similar or stricter SSL use setting. */
+ return (cftpc->use_ssl != CURLUSESSL_NONE);
+ default:
+ return (nftpc->use_ssl == cftpc->use_ssl);
}
- return TRUE;
}
/*