mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Parse cluster state file in IPv6 compatible way
We need to pick the port based on the _last_ colon, not the first one.
This commit is contained in:
parent
bbf1af2da3
commit
daca1edb6e
@ -178,7 +178,7 @@ int clusterLoadConfig(char *filename) {
|
|||||||
clusterAddNode(n);
|
clusterAddNode(n);
|
||||||
}
|
}
|
||||||
/* Address and port */
|
/* Address and port */
|
||||||
if ((p = strchr(argv[1],':')) == NULL) goto fmterr;
|
if ((p = strrchr(argv[1],':')) == NULL) goto fmterr;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
memcpy(n->ip,argv[1],strlen(argv[1])+1);
|
memcpy(n->ip,argv[1],strlen(argv[1])+1);
|
||||||
n->port = atoi(p+1);
|
n->port = atoi(p+1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user