From: Joe Orton Date: Thu, 4 Mar 2004 13:06:54 +0000 (+0000) Subject: * modules/ssl/mod_ssl.h: Declare ssl_is_https optional function. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bf6363f5629f5017e5353ff6b950a7804d1edf7;p=thirdparty%2Fapache%2Fhttpd.git * modules/ssl/mod_ssl.h: Declare ssl_is_https optional function. * modules/ssl/ssl_engine_vars (ssl_is_https): New function. (ssl_var_register): Register it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@102850 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/mod_ssl.h b/mod_ssl.h index 3c8f39a30f1..c52ec3b723e 100644 --- a/mod_ssl.h +++ b/mod_ssl.h @@ -26,6 +26,10 @@ APR_DECLARE_OPTIONAL_FN(char *, ssl_var_lookup, conn_rec *, request_rec *, char *)); +/* An optional function which returns non-zero if the given connection + * is using SSL/TLS. */ +APR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *)); + /* The ssl_proxy_enable() and ssl_engine_disable() optional functions * are used by mod_proxy to enable use of SSL for outgoing * connections. */ diff --git a/ssl_engine_vars.c b/ssl_engine_vars.c index c33afc05bdc..8d45cfd1b5c 100644 --- a/ssl_engine_vars.c +++ b/ssl_engine_vars.c @@ -48,8 +48,15 @@ static char *ssl_var_lookup_ssl_cipher(apr_pool_t *p, conn_rec *c, char *var); static void ssl_var_lookup_ssl_cipher_bits(SSL *ssl, int *usekeysize, int *algkeysize); static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var); +static int ssl_is_https(conn_rec *c) +{ + SSLConnRec *sslconn = myConnConfig(c); + return sslconn && sslconn->ssl; +} + void ssl_var_register(void) { + APR_REGISTER_OPTIONAL_FN(ssl_is_https); APR_REGISTER_OPTIONAL_FN(ssl_var_lookup); return; }