[sr-dev] git:master:395699a8: ndb_redis: rename variables to avoind name conflicts

Claudiu Boriga paul.boriga at 1and1.ro
Fri May 5 10:05:18 CEST 2017


Module: kamailio
Branch: master
Commit: 395699a80345e5721580ebac3b5944f603acdb32
URL: https://github.com/kamailio/kamailio/commit/395699a80345e5721580ebac3b5944f603acdb32

Author: Claudiu Boriga <paul.boriga at 1and1.ro>
Committer: Claudiu Boriga <paul.boriga at 1and1.ro>
Date: 2017-05-05T09:37:29+03:00

ndb_redis: rename variables to avoind name conflicts

---

Modified: src/modules/ndb_redis/ndb_redis_mod.c
Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  https://github.com/kamailio/kamailio/commit/395699a80345e5721580ebac3b5944f603acdb32.diff
Patch: https://github.com/kamailio/kamailio/commit/395699a80345e5721580ebac3b5944f603acdb32.patch

---

diff --git a/src/modules/ndb_redis/ndb_redis_mod.c b/src/modules/ndb_redis/ndb_redis_mod.c
index 0906aab..6e43849 100644
--- a/src/modules/ndb_redis/ndb_redis_mod.c
+++ b/src/modules/ndb_redis/ndb_redis_mod.c
@@ -48,8 +48,8 @@ int init_without_redis = 0;
 int redis_connect_timeout_param = 1000;
 int redis_cmd_timeout_param = 1000;
 int redis_cluster_param = 0;
-int disable_time=0;
-int allowed_timeouts=-1;
+int redis_disable_time_param=0;
+int redis_allowed_timeouts_param=-1;
 
 static int w_redis_cmd3(struct sip_msg* msg, char* ssrv, char* scmd,
 		char* sres);
@@ -122,8 +122,8 @@ static param_export_t params[]={
 	{"connect_timeout", INT_PARAM, &redis_connect_timeout_param},
 	{"cmd_timeout", INT_PARAM, &redis_cmd_timeout_param},
 	{"cluster", INT_PARAM, &redis_cluster_param},
-	{"disable_time", INT_PARAM, &disable_time},
-	{"allowed_timeouts", INT_PARAM, &allowed_timeouts},
+	{"disable_time", INT_PARAM, &redis_disable_time_param},
+	{"allowed_timeouts", INT_PARAM, &redis_allowed_timeouts_param},
 	{0, 0, 0}
 };
 
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 728a93d..0bf9838 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -49,8 +49,8 @@ extern int init_without_redis;
 extern int redis_connect_timeout_param;
 extern int redis_cmd_timeout_param;
 extern int redis_cluster_param;
-extern int disable_time;
-extern int allowed_timeouts;
+extern int redis_disable_time_param;
+extern int redis_allowed_timeouts_param;
 
 /* backwards compatibility with hiredis < 0.12 */
 #if (HIREDIS_MAJOR == 0) && (HIREDIS_MINOR < 12)
@@ -1043,17 +1043,17 @@ int redis_check_server(redisc_server_t *rsrv)
 
 int redis_count_err_and_disable(redisc_server_t *rsrv)
 {
-	if (allowed_timeouts < 0)
+	if (redis_allowed_timeouts_param < 0)
 	{
 		return 0;
 	}
 
 	rsrv->disable.consecutive_errors++;
-	if (rsrv->disable.consecutive_errors > allowed_timeouts)
+	if (rsrv->disable.consecutive_errors > redis_allowed_timeouts_param)
 	{
 		rsrv->disable.disabled=1;
-		rsrv->disable.restore_tick=get_ticks() + disable_time;
-		LM_WARN("REDIS server %.*s disabled for %d seconds",rsrv->sname->len,rsrv->sname->s,disable_time);
+		rsrv->disable.restore_tick=get_ticks() + redis_disable_time_param;
+		LM_WARN("REDIS server %.*s disabled for %d seconds",rsrv->sname->len,rsrv->sname->s,redis_disable_time_param);
 		return 1;
 	}
 	return 0;




More information about the sr-dev mailing list