diff options
author | rcritten <> | 2008-07-14 20:25:53 +0000 |
---|---|---|
committer | rcritten <> | 2008-07-14 20:25:53 +0000 |
commit | 503b4dfb861a4d3c41936cc9252817b06d865b69 (patch) | |
tree | b34c23d7d0cb299a060f2be3270d4a74ba02925b | |
parent | 9576f57fd1a88959404d3532888bf20c28649f88 (diff) | |
download | mod_nss-503b4dfb861a4d3c41936cc9252817b06d865b69.tar.gz mod_nss-503b4dfb861a4d3c41936cc9252817b06d865b69.tar.xz mod_nss-503b4dfb861a4d3c41936cc9252817b06d865b69.zip |
Don't inherit the MP cache when running in threaded mode
Don't initialize the database if the SSL is disabled in the configuration
454701
-rw-r--r-- | nss_engine_init.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/nss_engine_init.c b/nss_engine_init.c index c4e2d90..ed34ba1 100644 --- a/nss_engine_init.c +++ b/nss_engine_init.c @@ -1084,13 +1084,44 @@ void nss_init_Child(apr_pool_t *p, server_rec *base_server) SSLModConfigRec *mc = myModConfig(base_server); SSLSrvConfigRec *sc; server_rec *s; + int threaded = 0; + int sslenabled = FALSE; mc->pid = getpid(); /* only call getpid() once per-process */ - if (SSL_InheritMPServerSIDCache(NULL) != SECSuccess) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "SSL_InheritMPServerSIDCache failed"); - nss_log_nss_error(APLOG_MARK, APLOG_ERR, NULL); + /* + * First, see if ssl is enabled at all + */ + for (s = base_server; s; s = s->next) { + sc = mySrvConfig(s); + /* If any servers have SSL, we want sslenabled set so we + * can perform further initialization + */ + + if (sc->enabled == UNSET) { + sc->enabled = FALSE; + } + + if (sc->proxy_enabled == UNSET) { + sc->proxy_enabled = FALSE; + } + + if ((sc->enabled == TRUE) || (sc->proxy_enabled == TRUE)) { + sslenabled = TRUE; + } + } + + if (sslenabled == FALSE) { /* we are not an SSL/TLS server */ + return; + } + + ap_mpm_query(AP_MPMQ_MAX_THREADS, &threaded); + if (!threaded) { + if (SSL_InheritMPServerSIDCache(NULL) != SECSuccess) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, + "SSL_InheritMPServerSIDCache failed"); + nss_log_nss_error(APLOG_MARK, APLOG_ERR, NULL); + } } nss_init_SSLLibrary(base_server); |