Pārlūkot izejas kodu

ndb_redis: add result check when reconnecting

Reported and provided solution by @kritarthh

follow-up #2461
Victor Seva 4 gadi atpakaļ
vecāks
revīzija
f82a256300
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      src/modules/ndb_redis/redis_client.c

+ 5 - 0
src/modules/ndb_redis/redis_client.c

@@ -1059,6 +1059,11 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
 			if(redisc_reconnect_server(rsrv)==0)
 			if(redisc_reconnect_server(rsrv)==0)
 			{
 			{
 				rpl->rplRedis = redisvCommand(rsrv->ctxRedis, cmd->s, ap4);
 				rpl->rplRedis = redisvCommand(rsrv->ctxRedis, cmd->s, ap4);
+				if(rpl->rplRedis == NULL)
+				{
+					redis_count_err_and_disable(rsrv);
+					goto error_exec;
+				}
 			} else {
 			} else {
 				LM_ERR("unable to reconnect to redis server: %.*s\n",
 				LM_ERR("unable to reconnect to redis server: %.*s\n",
 						srv->len, srv->s);
 						srv->len, srv->s);