From: Joe Orton Date: Sun, 22 Feb 2004 10:23:01 +0000 (+0000) Subject: * modules/ssl/ssl_scache_shmcb.c (ssl_scache_shmcb_init): Use an X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b49a8b4007d8783633e6a4f49bc45c8476f1dd0b;p=thirdparty%2Fapache%2Fhttpd.git * 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/modules/ssl@102746 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_scache_shmcb.c b/ssl_scache_shmcb.c index 63cdee4c19f..ee870cc101f 100644 --- a/ssl_scache_shmcb.c +++ b/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,