httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1213401 - in /httpd/httpd/branches/2.4.x: docs/manual/mod/mod_slotmem_shm.xml modules/slotmem/mod_slotmem_shm.c
Date Mon, 12 Dec 2011 20:05:52 GMT
Author: jim
Date: Mon Dec 12 20:05:52 2011
New Revision: 1213401

URL: http://svn.apache.org/viewvc?rev=1213401&view=rev
Log:
Merge r1210261 from trunk:

mod_slotmem_shm: Remove the colon syntax to indicate a relative path, and
make the relative path default behaviour. Remove the word "anonymous" as
a filename for special treatment, what used to be "anonymous" is now "none".

Submitted by: minfrin
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_slotmem_shm.xml
    httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_slotmem_shm.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_slotmem_shm.xml?rev=1213401&r1=1213400&r2=1213401&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_slotmem_shm.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_slotmem_shm.xml Mon Dec 12 20:05:52 2011
@@ -54,12 +54,10 @@
        <dl>
          <dt><code>"none"</code></dt>
          <dd><code>Does not persist shared memory in file.</code></dd>
-         <dt><code>"anonymous"</code></dt>
-         <dd><code>$server_root/logs/anonymous.slotmem</code></dd>
-         <dt><code>":file-name"</code></dt>
-         <dd><code>$server_root/logs/file-name.slotmem</code></dd>
-         <dt><code>"absolute-file-name"</code></dt>
-         <dd><code>$absolute-file-name.slotmem</code></dd>
+         <dt><code>"file-name"</code></dt>
+         <dd><code>$server_root/file-name</code></dd>
+         <dt><code>"/absolute-file-name"</code></dt>
+         <dd><code>$absolute-file-name</code></dd>
        </dl></dd>
 
       <dt>apr_status_t attach(ap_slotmem_instance_t **new, const char *name, apr_size_t
*item_size, unsigned int *item_num, apr_pool_t *pool)</dt>

Modified: httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c?rev=1213401&r1=1213400&r2=1213401&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/branches/2.4.x/modules/slotmem/mod_slotmem_shm.c Mon Dec 12 20:05:52 2011
@@ -119,29 +119,24 @@ static apr_status_t unixd_set_shm_perms(
  * Persist the slotmem in a file
  * slotmem name and file name.
  * none      : no persistent data
- * anonymous : $server_root/logs/anonymous.slotmem
- * :rel_name : $server_root/logs/rel_name.slotmem
- * abs_name  : $abs_name.slotmem
+ * rel_name  : $server_root/rel_name
+ * /abs_name : $abs_name
  *
  */
 static const char *store_filename(apr_pool_t *pool, const char *slotmemname)
 {
     const char *storename;
     const char *fname;
-    if (strcasecmp(slotmemname, "none") == 0)
+    if (strcasecmp(slotmemname, "none") == 0) {
         return NULL;
-    else if (strcasecmp(slotmemname, "anonymous") == 0)
-        fname = ap_server_root_relative(pool, "logs/anonymous");
-    else if (slotmemname[0] == ':') {
-        const char *tmpname;
-        tmpname = apr_pstrcat(pool, "logs/", &slotmemname[1], NULL);
-        fname = ap_server_root_relative(pool, tmpname);
+    }
+    else if (slotmemname[0] != '/') {
+        fname = ap_server_root_relative(pool, slotmemname);
     }
     else {
         fname = slotmemname;
     }
-    storename = apr_pstrcat(pool, fname, ".slotmem", NULL);
-    return storename;
+    return fname;
 }
 
 static void store_slotmem(ap_slotmem_instance_t *slotmem)
@@ -269,14 +264,15 @@ static apr_status_t slotmem_create(ap_sl
                       (item_num * sizeof(char)) + basesize;
     apr_status_t rv;
 
-    if (gpool == NULL)
+    if (gpool == NULL) {
         return APR_ENOSHMAVAIL;
+    }
     if (name) {
-        if (name[0] == ':') {
-            fname = name;
+        if (name[0] != '/') {
+            fname = ap_server_root_relative(pool, name);
         }
         else {
-            fname = ap_server_root_relative(pool, name);
+            fname = name;
         }
 
         /* first try to attach to existing slotmem */
@@ -295,11 +291,11 @@ static apr_status_t slotmem_create(ap_sl
         }
     }
     else {
-        fname = "anonymous";
+        fname = "none";
     }
 
     /* first try to attach to existing shared memory */
-    fbased = (name && name[0] != ':');
+    fbased = (name != NULL);
     if (fbased) {
         rv = apr_shm_attach(&shm, fname, gpool);
     }



Mime
View raw message