From ba689780fa6f104119d6ce9ea7a7a0bf8714fc5d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 22 Feb 2004 10:23:01 +0000 Subject: [PATCH] * modules/ssl/ssl_scache_shmcb.c (ssl_scache_shmcb_init): Use an anonymous shm segment by default or fall back on name-based shm. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102746 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/ssl_scache_shmcb.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/ssl/ssl_scache_shmcb.c b/modules/ssl/ssl_scache_shmcb.c index 63cdee4c19..ee870cc101 100644 --- a/modules/ssl/ssl_scache_shmcb.c +++ b/modules/ssl/ssl_scache_shmcb.c @@ -339,10 +339,19 @@ void ssl_scache_shmcb_init(server_rec *s, apr_pool_t *p) ssl_die(); } - if ((rv = apr_shm_create(&(mc->pSessionCacheDataMM), - mc->nSessionCacheDataSize, - mc->szSessionCacheDataFile, - mc->pPool)) != APR_SUCCESS) { + /* Use anonymous shm by default, fall back on name-based. */ + rv = apr_shm_create(&(mc->pSessionCacheDataMM), + mc->nSessionCacheDataSize, + NULL, mc->pPool); + + if (APR_STATUS_IS_ENOTIMPL(rv)) { + rv = apr_shm_create(&(mc->pSessionCacheDataMM), + mc->nSessionCacheDataSize, + mc->szSessionCacheDataFile, + mc->pPool); + } + + if (rv != APR_SUCCESS) { char buf[100]; ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "Cannot allocate shared memory: (%d)%s", rv, -- 2.50.1