svn commit: r1925666 - in /apr/apr-util/branches/1.7.x: ./ include/apr_memcache.h memcache/apr_memcache.c test/testmemcache.c
[email protected] Sun, 18 May 2025 12:40:35 -0000
Newsgroups
gmane.comp.apache.apr.cvs
Message-ID
<[email protected] >
Author: ivan
Date: Sun May 18 12:40:35 2025
New Revision: 1925666
URL: http://svn.apache.org/viewvc?rev=1925666&view=rev
Log:
Merge r1910026 from apr/trunk:
Align the apr_memcache API with the apr_reslist API.
Modified:
apr/apr-util/branches/1.7.x/ (props changed)
apr/apr-util/branches/1.7.x/include/apr_memcache.h
apr/apr-util/branches/1.7.x/memcache/apr_memcache.c
apr/apr-util/branches/1.7.x/test/testmemcache.c
Propchange: apr/apr-util/branches/1.7.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1910026
Modified: apr/apr-util/branches/1.7.x/include/apr_memcache.h
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/include/apr_memcache.h?rev=1925666&r1=1925665&r2=1925666&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/include/apr_memcache.h (original)
+++ apr/apr-util/branches/1.7.x/include/apr_memcache.h Sun May 18 12:40:35 2025
@@ -74,10 +74,10 @@ struct apr_memcache_server_t
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;
+ int min;
+ int smax;
+ int max;
+ apr_interval_time_t ttl;
#endif
};
@@ -246,10 +246,10 @@ APU_DECLARE(apr_time_t) apr_memcache_get
APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p,
const char *host,
apr_port_t port,
- apr_uint32_t min,
- apr_uint32_t smax,
- apr_uint32_t max,
- apr_uint32_t ttl,
+ int min,
+ int smax,
+ int max,
+ apr_interval_time_t ttl,
apr_memcache_server_t **ns);
/**
* Creates a new memcached client object
Modified: apr/apr-util/branches/1.7.x/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/memcache/apr_memcache.c?rev=1925666&r1=1925665&r2=1925666&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/memcache/apr_memcache.c (original)
+++ apr/apr-util/branches/1.7.x/memcache/apr_memcache.c Sun May 18 12:40:35 2025
@@ -459,8 +459,8 @@ mc_conn_destruct(void *conn_, void *para
APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p,
const char *host, apr_port_t port,
- apr_uint32_t min, apr_uint32_t smax,
- apr_uint32_t max, apr_uint32_t ttl,
+ int min, int smax,
+ int max, apr_interval_time_t ttl,
apr_memcache_server_t **ms)
{
apr_status_t rv = APR_SUCCESS;
Modified: apr/apr-util/branches/1.7.x/test/testmemcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/test/testmemcache.c?rev=1925666&r1=1925665&r2=1925666&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/test/testmemcache.c (original)
+++ apr/apr-util/branches/1.7.x/test/testmemcache.c Sun May 18 12:40:35 2025
@@ -241,7 +241,8 @@ static void test_memcache_create(abts_ca
port = PORT + i;
rv =
- apr_memcache_server_create(pool, HOST, PORT + i, 0, 1, 1, 60, &server);
+ apr_memcache_server_create(pool, HOST, PORT + i, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -263,7 +264,8 @@ static void test_memcache_create(abts_ca
ABTS_PTR_NOTNULL(tc, s);
}
- rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server);
+ rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -322,7 +324,8 @@ static void test_memcache_user_funcs(abt
for(i = 1; i <= 10; i++) {
apr_memcache_server_t *ms;
- rv = apr_memcache_server_create(pool, HOST, i, 0, 1, 1, 60, &ms);
+ rv = apr_memcache_server_create(pool, HOST, i, 0, 1, 1,
+ apr_time_from_sec(60), &ms);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, ms);
@@ -358,7 +361,8 @@ static void test_memcache_meta(abts_case
rv = apr_memcache_create(pool, 1, 0, &memcache);
ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS);
- rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server);
+ rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -427,7 +431,8 @@ static void test_memcache_addreplace(abt
rv = apr_memcache_create(pool, 1, 0, &memcache);
ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS);
- rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server);
+ rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -491,7 +496,8 @@ static void test_memcache_incrdecr(abts_
rv = apr_memcache_create(pool, 1, 0, &memcache);
ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS);
- rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server);
+ rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -548,7 +554,8 @@ static void test_memcache_multiget(abts_
rv = apr_memcache_create(pool, 1, 0, &memcache);
ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS);
- rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server);
+ rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -621,7 +628,8 @@ static void test_memcache_setget(abts_ca
rv = apr_memcache_create(pool, 1, 0, &memcache);
ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS);
- rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server);
+ rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1,
+ apr_time_from_sec(60), &server);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, server);
@@ -714,7 +722,8 @@ static void test_connection_validation(a
rv = apr_memcache_create(p, 1, 0, &memcache);
ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS);
- rv = apr_memcache_server_create(p, MOCK_HOST, MOCK_PORT, 0, 1, 1, 60000, &memserver);
+ rv = apr_memcache_server_create(p, MOCK_HOST, MOCK_PORT, 0, 1, 1,
+ apr_time_from_sec(60), &memserver);
ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
rv = apr_memcache_add_server(memcache, memserver);