From: Yann Ylavic Date: Sat, 1 Mar 2014 21:36:27 +0000 (+0000) Subject: mod_proxy: Add comment and avoid ternary operator as condition (no functional change). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=012add21ac64feeb40a81a6f0ac17b00b0e14443;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy: Add comment and avoid ternary operator as condition (no functional change). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1573229 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 7fafbfdcf35..23dfba334b4 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2367,10 +2367,14 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, else { ssl_hostname = conn->hostname; } - if (conn->ssl_hostname != NULL - ? (ssl_hostname == NULL || strcasecmp(conn->ssl_hostname, - ssl_hostname) != 0) - : (ssl_hostname != NULL && conn->sock)) { + /* + * Close if a SNI is in use but this request requires no or + * a different one, or no SNI is in use but one is required. + */ + if ((conn->ssl_hostname && (!ssl_hostname || + strcasecmp(conn->ssl_hostname, + ssl_hostname) != 0)) || + (!conn->ssl_hostname && ssl_hostname && conn->sock)) { socket_cleanup(conn); } if (conn->ssl_hostname == NULL) {