You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rp...@apache.org on 2023/04/28 14:30:11 UTC

svn commit: r1909474 - in /apr/apr/trunk: include/apr_memcache.h memcache/apr_memcache.c

Author: rpluem
Date: Fri Apr 28 14:30:11 2023
New Revision: 1909474

URL: http://svn.apache.org/viewvc?rev=1909474&view=rev
Log:
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.

Modified:
    apr/apr/trunk/include/apr_memcache.h
    apr/apr/trunk/memcache/apr_memcache.c

Modified: apr/apr/trunk/include/apr_memcache.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_memcache.h?rev=1909474&r1=1909473&r2=1909474&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_memcache.h (original)
+++ apr/apr/trunk/include/apr_memcache.h Fri Apr 28 14:30:11 2023
@@ -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.

Modified: apr/apr/trunk/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memcache/apr_memcache.c?rev=1909474&r1=1909473&r2=1909474&view=diff
==============================================================================
--- apr/apr/trunk/memcache/apr_memcache.c (original)
+++ apr/apr/trunk/memcache/apr_memcache.c Fri Apr 28 14:30:11 2023
@@ -435,6 +435,11 @@ APR_DECLARE(apr_status_t) apr_memcache_s
         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);