mirror of
https://github.com/curl/curl.git
synced 2026-08-01 08:08:04 +03:00
lib: SSL connection reuse
Protocol handlers not flagging PROTOPT_SSL that allow reuse of existing SSL connections now need to carry the flag PROTOPT_SSL_REUSE. Add PROTOPT_SSL_REUSE to imap, ldap, pop3, smtp and ftp. Add tests the http: urls do not reuse https: connections and vice versa. Reported-by: Sakthi SK Fixes #19006 Closes #19007
This commit is contained in:
parent
dd7762c309
commit
6e35eb4879
9 changed files with 35 additions and 10 deletions
|
|
@ -932,15 +932,16 @@ static bool url_match_multiplex_limits(struct connectdata *conn,
|
|||
static bool url_match_ssl_use(struct connectdata *conn,
|
||||
struct url_conn_match *m)
|
||||
{
|
||||
if(m->needle->handler->flags&PROTOPT_SSL) {
|
||||
if(m->needle->handler->flags & PROTOPT_SSL) {
|
||||
/* We are looking for SSL, if `conn` does not do it, not a match. */
|
||||
if(!Curl_conn_is_ssl(conn, FIRSTSOCKET))
|
||||
return FALSE;
|
||||
}
|
||||
else if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) {
|
||||
/* We are not *requiring* SSL, however `conn` has it. If the
|
||||
* protocol *family* is not the same, not a match. */
|
||||
if(get_protocol_family(conn->handler) != m->needle->handler->protocol)
|
||||
/* If the protocol does not allow reuse of SSL connections OR
|
||||
is of another protocol family, not a match. */
|
||||
if(!(m->needle->handler->flags & PROTOPT_SSL_REUSE) ||
|
||||
(get_protocol_family(conn->handler) != m->needle->handler->protocol))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue