You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jf...@apache.org on 2006/07/20 22:49:57 UTC

svn commit: r424059 - in /httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem: mod_plainmem.c mod_scoreboard.c mod_sharedmem.c

Author: jfclere
Date: Thu Jul 20 13:49:56 2006
New Revision: 424059

URL: http://svn.apache.org/viewvc?rev=424059&view=rev
Log:
Correct small errors: Thanks Ruediger Pluem who review the code.

Modified:
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_plainmem.c
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_scoreboard.c
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_plainmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_plainmem.c?rev=424059&r1=424058&r2=424059&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_plainmem.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_plainmem.c Thu Jul 20 13:49:56 2006
@@ -73,7 +73,7 @@
                 *new = next;
                 return APR_SUCCESS;
             }
-            if (next->next)
+            if (!next->next)
                 break;
             next = next->next;
         }
@@ -84,7 +84,6 @@
     res->base =  apr_pcalloc(globalpool, item_size * item_num);
     if (!res->base)
         return APR_ENOSHMAVAIL;
-    memset(res->base, 0, item_size * item_num);
 
     /* For the chained slotmem stuff */
     res->name = apr_pstrdup(globalpool, fname);
@@ -102,13 +101,14 @@
 static apr_status_t ap_slotmem_mem(ap_slotmem_t *score, int id, void**mem)
 {
 
-    void *ptr = score->base + score->size * id;
+    void *ptr;
 
     if (!score)
         return APR_ENOSHMAVAIL;
     if (id<0 || id>score->num)
         return APR_ENOSHMAVAIL;
 
+    ptr = score->base + score->size * id;
     if (!ptr)
         return APR_ENOSHMAVAIL;
     *mem = ptr;

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_scoreboard.c?rev=424059&r1=424058&r2=424059&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_scoreboard.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_scoreboard.c Thu Jul 20 13:49:56 2006
@@ -82,9 +82,6 @@
     res->size = item_size;
     res->num = item_num;
     *new = res;
-    ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
-                "ap_slotmem_create: score %d", score);
-
     return APR_SUCCESS;
 }
 static apr_status_t ap_slotmem_mem(ap_slotmem_t *score, int id, void**mem)
@@ -103,8 +100,6 @@
     if (!ptr)
         return APR_ENOSHMAVAIL;
     *mem = ptr;
-    ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
-                "ap_slotmem_mem: score %d", score);
     return APR_SUCCESS;
 }
 

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c?rev=424059&r1=424058&r2=424059&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c Thu Jul 20 13:49:56 2006
@@ -90,7 +90,7 @@
                 *new = next;
                 return APR_SUCCESS;
             }
-            if (next->next)
+            if (!next->next)
                 break;
             next = next->next;
         }
@@ -130,15 +130,14 @@
 static apr_status_t ap_slotmem_mem(ap_slotmem_t *score, int id, void**mem)
 {
 
-    void *ptr = score->base + score->size * id;
+    void *ptr;
 
     if (!score)
         return APR_ENOSHMAVAIL;
     if (id<0 || id>score->num)
         return APR_ENOSHMAVAIL;
-    if (apr_shm_size_get(score->shm) != score->size * score->num)
-        return APR_ENOSHMAVAIL;
 
+    ptr = score->base + score->size * id;
     if (!ptr)
         return APR_ENOSHMAVAIL;
     *mem = ptr;
@@ -154,10 +153,6 @@
 /* make sure the shared memory is cleaned */
 static int initialize_cleanup(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 {
-    ap_slotmem_t *next = globallistmem;
-    while (next) {
-        next = next->next;
-    }
     apr_pool_cleanup_register(p, &globallistmem, cleanup_slotmem, apr_pool_cleanup_null);
     return OK;
 }