diff options
author | Ruediger Pluem <rpluem@apache.org> | 2023-04-28 14:30:11 +0000 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2023-04-28 14:30:11 +0000 |
commit | 572ffea6a5b1aae06333385cbbec0069c6140ba2 (patch) | |
tree | 6c829caa4df6f434720e122d26e848fad75ca146 | |
parent | 62585148922f63ec1a8f1a8683dcf7b5749d694e (diff) | |
download | apr-572ffea6a5b1aae06333385cbbec0069c6140ba2.tar.gz |
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
-rw-r--r-- | include/apr_memcache.h | 7 | ||||
-rw-r--r-- | memcache/apr_memcache.c | 5 |
2 files changed, 12 insertions, 0 deletions
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); |