httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r820755 - in /httpd/httpd/trunk/modules/slotmem: mod_slotmem_plain.c mod_slotmem_shm.c
Date Thu, 01 Oct 2009 19:17:03 GMT
Author: jim
Date: Thu Oct  1 19:17:02 2009
New Revision: 820755

URL: http://svn.apache.org/viewvc?rev=820755&view=rev
Log:
Allow for pass-thru or early termination of doall() loops

Modified:
    httpd/httpd/trunk/modules/slotmem/mod_slotmem_plain.c
    httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c

Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_plain.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_plain.c?rev=820755&r1=820754&r2=820755&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_plain.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_plain.c Thu Oct  1 19:17:02 2009
@@ -43,6 +43,8 @@
     unsigned int i;
     void *ptr;
     char *inuse;
+    apr_status_t retval = APR_SUCCESS;
+    
 
     if (!mem)
         return APR_ENOSHMAVAIL;
@@ -52,11 +54,13 @@
     for (i = 0; i < mem->num; i++, inuse++) {
         if (!AP_SLOTMEM_IS_PREGRAB(mem) ||
            (AP_SLOTMEM_IS_PREGRAB(mem) && *inuse)) {
-            func((void *) ptr, data, pool);
+            retval = func((void *) ptr, data, pool);
+            if (retval != APR_SUCCESS)
+                break;
         }
         ptr += mem->size;
     }
-    return APR_SUCCESS;
+    return retval;
 }
 
 static apr_status_t slotmem_create(ap_slotmem_instance_t **new, const char *name, apr_size_t
item_size, unsigned int item_num, ap_slotmem_type_t type, apr_pool_t *pool)

Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=820755&r1=820754&r2=820755&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Thu Oct  1 19:17:02 2009
@@ -207,6 +207,7 @@
     unsigned int i;
     void *ptr;
     char *inuse;
+    apr_status_t retval = APR_SUCCESS;
 
     if (!mem) {
         return APR_ENOSHMAVAIL;
@@ -217,11 +218,13 @@
     for (i = 0; i < mem->desc.num; i++, inuse++) {
         if (!AP_SLOTMEM_IS_PREGRAB(mem) ||
            (AP_SLOTMEM_IS_PREGRAB(mem) && *inuse)) {
-            func((void *) ptr, data, pool);
+            retval = func((void *) ptr, data, pool);
+            if (retval != APR_SUCCESS)
+                break;
         }
         ptr += mem->desc.size;
     }
-    return APR_SUCCESS;
+    return retval;
 }
 
 static apr_status_t slotmem_create(ap_slotmem_instance_t **new,



Mime
View raw message