mirror of https://mirror.osredm.com/root/redis.git
Fix redis-benchmark --cluster with IPv6. (#10393)
Currently, CLUSTER NODES is parsed and was not done correctly for IPv6 addresses.
This commit is contained in:
parent
7ef68cd5ec
commit
38052fd702
|
@ -1118,6 +1118,9 @@ static clusterNode **addClusterNode(clusterNode *node) {
|
||||||
return config.cluster_nodes;
|
return config.cluster_nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: This should be refactored to use CLUSTER SLOTS, the migrating/importing
|
||||||
|
* information is anyway not used.
|
||||||
|
*/
|
||||||
static int fetchClusterConfiguration() {
|
static int fetchClusterConfiguration() {
|
||||||
int success = 1;
|
int success = 1;
|
||||||
redisContext *ctx = NULL;
|
redisContext *ctx = NULL;
|
||||||
|
@ -1179,7 +1182,7 @@ static int fetchClusterConfiguration() {
|
||||||
clusterNode *node = NULL;
|
clusterNode *node = NULL;
|
||||||
char *ip = NULL;
|
char *ip = NULL;
|
||||||
int port = 0;
|
int port = 0;
|
||||||
char *paddr = strchr(addr, ':');
|
char *paddr = strrchr(addr, ':');
|
||||||
if (paddr != NULL) {
|
if (paddr != NULL) {
|
||||||
*paddr = '\0';
|
*paddr = '\0';
|
||||||
ip = addr;
|
ip = addr;
|
||||||
|
|
Loading…
Reference in New Issue