Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2f31545b
Commit
2f31545b
authored
Apr 20, 2018
by
artix
Browse files
Cluster Manager: fixed bug when parsing CLUSTER NODES reply (clusterManagerNodeLoadInfo)
parent
5bc2c987
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
2f31545b
...
@@ -2922,6 +2922,7 @@ static int clusterManagerNodeLoadInfo(clusterManagerNode *node, int opts,
...
@@ -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,
...
@@ -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:
...
@@ -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--;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment