summaryrefslogtreecommitdiff
path: root/util-misc
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-06-21 14:35:17 +0000
committerYann Ylavic <ylavic@apache.org>2018-06-21 14:35:17 +0000
commitddd1fef17274ddfd8a78f5278b61788aab2f6bad (patch)
treed888b2835063202d7eaec51092dd310b591f6c73 /util-misc
parent2c337e88b22cefb707b9502c08d33bb0c1e9bb4b (diff)
downloadapr-ddd1fef17274ddfd8a78f5278b61788aab2f6bad.tar.gz
apr_reslist: fix release of resource with zero/no TTL.
Ignore expiry when ttl=0 in apr_reslist_maintain(), like apr_reslist_acquire(). While ttl=0 is supposed to mean no TTL/expiry, apr_reslist_maintain() hence apr_reslist_release() were destroying all resources above smax in this case. Corresponding test already committed in r1834022. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834023 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'util-misc')
-rw-r--r--util-misc/apr_reslist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c
index ecc17a7d4..0373fbc53 100644
--- a/util-misc/apr_reslist.c
+++ b/util-misc/apr_reslist.c
@@ -212,8 +212,10 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist)
created_one++;
}
- /* We don't need to see if we're over the max if we were under it before */
- if (created_one) {
+ /* We don't need to see if we're over the max if we were under it before,
+ * nor need we check for expiry if no ttl is configure.
+ */
+ if (created_one || !reslist->ttl) {
#if APR_HAS_THREADS
apr_thread_mutex_unlock(reslist->listlock);
#endif