mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Cluster Manager: fixed bug when parsing CLUSTER NODES reply (clusterManagerNodeLoadInfo)
This commit is contained in:
parent
5bc2c98789
commit
2f31545beb
@ -2922,6 +2922,7 @@ static int clusterManagerNodeLoadInfo(clusterManagerNode *node, int opts,
|
|||||||
line = p + 1;
|
line = p + 1;
|
||||||
remaining--;
|
remaining--;
|
||||||
} else line = p;
|
} else line = p;
|
||||||
|
char *dash = NULL;
|
||||||
if (slotsdef[0] == '[') {
|
if (slotsdef[0] == '[') {
|
||||||
slotsdef++;
|
slotsdef++;
|
||||||
if ((p = strstr(slotsdef, "->-"))) { // Migrating
|
if ((p = strstr(slotsdef, "->-"))) { // Migrating
|
||||||
@ -2953,7 +2954,8 @@ static int clusterManagerNodeLoadInfo(clusterManagerNode *node, int opts,
|
|||||||
node->importing[node->importing_count - 1] =
|
node->importing[node->importing_count - 1] =
|
||||||
src;
|
src;
|
||||||
}
|
}
|
||||||
} else if ((p = strchr(slotsdef, '-')) != NULL) {
|
} else if ((dash = strchr(slotsdef, '-')) != NULL) {
|
||||||
|
p = dash;
|
||||||
int start, stop;
|
int start, stop;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
start = atoi(slotsdef);
|
start = atoi(slotsdef);
|
||||||
@ -5078,7 +5080,7 @@ invalid_args:
|
|||||||
static int clusterManagerCommandCall(int argc, char **argv) {
|
static int clusterManagerCommandCall(int argc, char **argv) {
|
||||||
int port = 0, i;
|
int port = 0, i;
|
||||||
char *ip = NULL;
|
char *ip = NULL;
|
||||||
if (!getClusterHostFromCmdArgs(argc, argv, &ip, &port)) goto invalid_args;
|
if (!getClusterHostFromCmdArgs(1, argv, &ip, &port)) goto invalid_args;
|
||||||
clusterManagerNode *refnode = clusterManagerNewNode(ip, port);
|
clusterManagerNode *refnode = clusterManagerNewNode(ip, port);
|
||||||
if (!clusterManagerLoadInfoFromNode(refnode, 0)) return 0;
|
if (!clusterManagerLoadInfoFromNode(refnode, 0)) return 0;
|
||||||
argc--;
|
argc--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user