Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2014-07-17 03:07:11 +0400
committermichael-grunder <michael.grunder@gmail.com>2015-05-06 01:05:29 +0300
commit6b3108837588dbb445d7a9910d6582f9cce707e6 (patch)
tree34717f6ff3fc84f9add96e626b08a9c6c70db49b /cluster_library.c
parent394708cbd48c715f9acb86e5ef1ec01309f70b5e (diff)
Check for empty slave hosts
CLUSTER SLOTS will return "" as the slave host for failed slaves, so we should skip them in node discovery.
Diffstat (limited to 'cluster_library.c')
-rw-r--r--cluster_library.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cluster_library.c b/cluster_library.c
index c05064be..c681a17e 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -685,7 +685,10 @@ static int cluster_map_slots(redisCluster *c, clusterReply *r) {
if(!VALIDATE_SLOTS_INNER(r3)) {
return -1;
}
-
+
+ // Skip slaves where the host is ""
+ if(r3->element[0]->len == 0) continue;
+
// Attach this node to our slave
slave = cluster_node_create(c, r3->element[0]->str,
(int)r3->element[0]->len,