summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniq <niq@13f79535-47bb-0310-9956-ffa450edef68>2008-05-28 19:59:38 +0000
committerniq <niq@13f79535-47bb-0310-9956-ffa450edef68>2008-05-28 19:59:38 +0000
commit5a459d2a470acc7b11660df9f83b5fcf13c4e172 (patch)
tree6b4d0bc3318afb3f29624fb71ccdb0465a86476a
parentc329f7cfb6cd47b499640ac5d22708936746e133 (diff)
downloadlibapr-util-5a459d2a470acc7b11660df9f83b5fcf13c4e172.tar.gz
apr_reslist: destroy all resources in a cleanup (don't stop immediately
on error) PR 45086 git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@661063 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES7
-rw-r--r--misc/apr_reslist.c12
2 files changed, 12 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index acd015e6..9489ee6a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,14 +1,17 @@
-*- coding: utf-8 -*-
Changes with APR-util 1.4.0
- *) Amend apr_reslist to expire resources whose idle time exceeds ttl.
- PR 42841 [Tom Donovan, Nick Kew, Ruediger Pluem]
+ *) apr_reslist: destroy all resources in apr_cleanup.
+ PR 45086 [Nick Kew]
*) Add DTrace Probes to Hooks, making it easier to inspect APR Hook based
applications with DTrace. [Theo Schlossnagle <jesus omniti.com>]
Changes with APR-util 1.3.0
+ *) Amend apr_reslist to expire resources whose idle time exceeds ttl.
+ PR 42841 [Tom Donovan, Nick Kew, Ruediger Pluem]
+
*) Modularize ldap's stub with the dbd dso modular structure, and teach
the apu dso's to respect the system specific shared lib path var.
To link to an application without ldap libs, query
diff --git a/misc/apr_reslist.c b/misc/apr_reslist.c
index 46087bb4..14b7e6c4 100644
--- a/misc/apr_reslist.c
+++ b/misc/apr_reslist.c
@@ -137,18 +137,20 @@ static apr_status_t destroy_resource(apr_reslist_t *reslist, apr_res_t *res)
static apr_status_t reslist_cleanup(void *data_)
{
- apr_status_t rv;
+ apr_status_t rv = APR_SUCCESS;
apr_reslist_t *rl = data_;
apr_res_t *res;
apr_thread_mutex_lock(rl->listlock);
while (rl->nidle > 0) {
+ apr_status_t rv1;
res = pop_resource(rl);
rl->ntotal--;
- rv = destroy_resource(rl, res);
- if (rv != APR_SUCCESS) {
- return rv;
+ rv1 = destroy_resource(rl, res);
+ if (rv1 != APR_SUCCESS) {
+ rv = rv1; /* loses info in the unlikely event of
+ * multiple *different* failures */
}
free_container(rl, res);
}
@@ -159,7 +161,7 @@ static apr_status_t reslist_cleanup(void *data_)
apr_thread_mutex_destroy(rl->listlock);
apr_thread_cond_destroy(rl->avail);
- return APR_SUCCESS;
+ return rv;
}
/**