apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1767979 - in /apr/apr-util/branches/1.6.x: redis/apr_redis.c test/testredis.c
Date Thu, 03 Nov 2016 21:28:29 GMT
Author: jim
Date: Thu Nov  3 21:28:29 2016
New Revision: 1767979

URL: http://svn.apache.org/viewvc?rev=1767979&view=rev
Log:
Some tuning

Modified:
    apr/apr-util/branches/1.6.x/redis/apr_redis.c
    apr/apr-util/branches/1.6.x/test/testredis.c

Modified: apr/apr-util/branches/1.6.x/redis/apr_redis.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/redis/apr_redis.c?rev=1767979&r1=1767978&r2=1767979&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/redis/apr_redis.c (original)
+++ apr/apr-util/branches/1.6.x/redis/apr_redis.c Thu Nov  3 21:28:29 2016
@@ -156,6 +156,17 @@ APU_DECLARE(apr_status_t) apr_redis_add_
 static apr_status_t rc_ping(apr_redis_server_t *rs);
 
 APU_DECLARE(apr_redis_server_t *)
+apr_redis_find_server_hash(apr_redis_t *rc, const apr_uint32_t hash)
+{
+    if (rc->server_func) {
+        return rc->server_func(rc->server_baton, rc, hash);
+    }
+    else {
+        return apr_redis_find_server_hash_default(NULL, rc, hash);
+    }
+}
+
+APU_DECLARE(apr_redis_server_t *)
     apr_redis_find_server_hash_default(void *baton, apr_redis_t *rc,
                                    const apr_uint32_t hash)
 {
@@ -206,17 +217,6 @@ APU_DECLARE(apr_redis_server_t *)
     return rs;
 }
 
-APU_DECLARE(apr_redis_server_t *)
-    apr_redis_find_server_hash(apr_redis_t *rc, const apr_uint32_t hash)
-{
-    if (rc->server_func) {
-        return rc->server_func(rc->server_baton, rc, hash);
-    }
-    else {
-        return apr_redis_find_server_hash_default(NULL, rc, hash);
-    }
-}
-
 APU_DECLARE(apr_redis_server_t *) apr_redis_find_server(apr_redis_t *rc,
                                                         const char *host,
                                                         apr_port_t port)
@@ -994,9 +994,7 @@ APU_DECLARE(apr_status_t) apr_redis_getp
         rv = grab_bulk_resp(rs, rc, conn, p, baton, new_length);
     }
     else {
-        rs_bad_conn(rs, conn);
-        apr_redis_disable_server(rc, rs);
-        return (APR_EGENERAL);
+        rv = APR_EGENERAL;
     }
 
     rs_release_conn(rs, conn);

Modified: apr/apr-util/branches/1.6.x/test/testredis.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/test/testredis.c?rev=1767979&r1=1767978&r2=1767979&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/test/testredis.c (original)
+++ apr/apr-util/branches/1.6.x/test/testredis.c Thu Nov  3 21:28:29 2016
@@ -146,7 +146,7 @@ static void test_redis_create(abts_case
     
     port = PORT + i;
     rv =
-      apr_redis_server_create(pool, HOST, PORT + i, 0, 1, 1, 60, 5, &server);
+      apr_redis_server_create(pool, HOST, PORT + i, 0, 1, 1, 60, 60, &server);
     ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
     
     rv = apr_redis_add_server(redis, server);
@@ -168,7 +168,7 @@ static void test_redis_create(abts_case
     ABTS_PTR_NOTNULL(tc, s);
   }
 
-  rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 5, &server);
+  rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server);
   ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
   
   rv = apr_redis_add_server(redis, server);
@@ -222,7 +222,7 @@ static void test_redis_user_funcs(abts_c
   for(i = 1; i <= 10; i++) {
     apr_redis_server_t *ms;
 
-    rv = apr_redis_server_create(pool, HOST, i, 0, 1, 1, 60, 5, &ms);
+    rv = apr_redis_server_create(pool, HOST, i, 0, 1, 1, 60, 60, &ms);
     ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
     
     rv = apr_redis_add_server(redis, ms);
@@ -253,7 +253,7 @@ static void test_redis_meta(abts_case *
     rv = apr_redis_create(pool, 1, 0, &redis);
     ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS);
 
-    rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 5, &server);
+    rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server);
     ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
 
     rv = apr_redis_add_server(redis, server);
@@ -309,7 +309,7 @@ static void test_redis_incrdecr(abts_cas
   rv = apr_redis_create(pool, 1, 0, &redis);
   ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS);
   
-  rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 5, &server);
+  rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server);
   ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
   
   rv = apr_redis_add_server(redis, server);
@@ -364,7 +364,7 @@ static void test_redis_setget(abts_case
     rv = apr_redis_create(pool, 1, 0, &redis);
     ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS);
 
-    rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 5, &server);
+    rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server);
     ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS);
 
     rv = apr_redis_add_server(redis, server);



Mime
View raw message