]> granicus.if.org Git - apache/commitdiff
* modules/ssl/ssl_scache_shmcb.c (ssl_scache_shmcb_init): Use an
authorJoe Orton <jorton@apache.org>
Sun, 22 Feb 2004 10:23:01 +0000 (10:23 +0000)
committerJoe Orton <jorton@apache.org>
Sun, 22 Feb 2004 10:23:01 +0000 (10:23 +0000)
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

index 63cdee4c19fc92b34cb4c423d37b447dc40bd67a..ee870cc101f0bad0a9989ebd1320d9a8dbf7558e 100644 (file)
@@ -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,