Browse Source

ndb_redis: rename variables to avoind name conflicts

Claudiu Boriga 8 years ago
parent
commit
395699a803
2 changed files with 10 additions and 10 deletions
  1. 4 4
      src/modules/ndb_redis/ndb_redis_mod.c
  2. 6 6
      src/modules/ndb_redis/redis_client.c

+ 4 - 4
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}
 };
 

+ 6 - 6
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;