Module: kamailio
Branch: 5.4
Commit: 3945ea2b7e59a6d6385344967a24b7bcdfd5f307
URL:
https://github.com/kamailio/kamailio/commit/3945ea2b7e59a6d6385344967a24b7b…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2021-03-02T15:28:52+01:00
ndb_redis: add result check when reconnecting
Reported and provided solution by @kritarthh
follow-up #2461
(cherry picked from commit f82a2563000361b6b1b12b4bb72b9a8ee4c62292)
---
Modified: src/modules/ndb_redis/redis_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3945ea2b7e59a6d6385344967a24b7b…
Patch:
https://github.com/kamailio/kamailio/commit/3945ea2b7e59a6d6385344967a24b7b…
---
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 15a86f7b10..e34b110eda 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/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)
{
rpl->rplRedis = redisvCommand(rsrv->ctxRedis, cmd->s, ap4);
+ if(rpl->rplRedis == NULL)
+ {
+ redis_count_err_and_disable(rsrv);
+ goto error_exec;
+ }
} else {
LM_ERR("unable to reconnect to redis server: %.*s\n",
srv->len, srv->s);