From 572ffea6a5b1aae06333385cbbec0069c6140ba2 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Fri, 28 Apr 2023 14:30:11 +0000 Subject: In case that we have threads store the apr_reslist parameters in the apr_memcache_server_t struct for later usage. * include/apr_memcache.h::struct apr_memcache_server_t: Add missing fields to struct. * memcache/apr_memcache.c::apr_memcache_server_create: Init fields with given values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909474 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memcache.h | 7 +++++++ memcache/apr_memcache.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/apr_memcache.h b/include/apr_memcache.h index 7e376e602..56d5d8d68 100644 --- a/include/apr_memcache.h +++ b/include/apr_memcache.h @@ -72,6 +72,13 @@ struct apr_memcache_server_t apr_thread_mutex_t *lock; #endif apr_time_t btime; +#if APR_HAS_THREADS + /** Resource list parameters */ + apr_uint32_t min; + apr_uint32_t smax; + apr_uint32_t max; + apr_uint32_t ttl; +#endif }; /* Custom hash callback function prototype, user for server selection. diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 18806281a..52e29e19e 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -435,6 +435,11 @@ APR_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, return rv; } + server->min = min; + server->smax = smax; + server->max = max; + server->ttl = ttl; + apr_reslist_cleanup_order_set(server->conns, APR_RESLIST_CLEANUP_FIRST); #else rv = mc_conn_construct((void**)&(server->conn), server, np); -- cgit v1.2.1