[sr-dev] git:master:5557b9b7: ndb_redis: fix cluster support

Victor Seva linuxmaniac at torreviejawireless.org
Mon Sep 21 09:54:53 CEST 2020


Module: kamailio
Branch: master
Commit: 5557b9b715a9ca754c454b5edaebf2a43b832015
URL: https://github.com/kamailio/kamailio/commit/5557b9b715a9ca754c454b5edaebf2a43b832015

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2020-09-21T09:49:25+02:00

ndb_redis: fix cluster support

fixes #2461 related #2300

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5557b9b715a9ca754c454b5edaebf2a43b832015.diff
Patch: https://github.com/kamailio/kamailio/commit/5557b9b715a9ca754c454b5edaebf2a43b832015.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 5ad063f89a..5bc1bf0e47 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -1032,13 +1032,6 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
 		}
 	}
 
-	LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
-	if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
-		LM_ERR("Redis error:%.*s\n",
-			(int)rpl->rplRedis->len, rpl->rplRedis->str);
-		goto error_exec;
-	}
-
 	if (check_cluster_reply(rpl->rplRedis, &rsrv)) {
 		LM_DBG("rsrv->ctxRedis = %p\n", rsrv->ctxRedis);
 		if(rsrv->ctxRedis==NULL)
@@ -1073,14 +1066,15 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
 				goto error_exec;
 			}
 		}
+	}
 
-		LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
-		if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
-			LM_ERR("Redis error:%.*s\n",
-				(int)rpl->rplRedis->len, rpl->rplRedis->str);
-			goto error_exec;
-		}
+	LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
+	if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
+		LM_ERR("Redis error:%.*s\n",
+			(int)rpl->rplRedis->len, rpl->rplRedis->str);
+		goto error_exec;
 	}
+
 	STR_ZTOV(cmd->s[cmd->len], c);
 	rsrv->disable.consecutive_errors = 0;
 	va_end(ap);




More information about the sr-dev mailing list