Cleanup all IP formatting code

Instead of manually checking for strchr(n,':') everywhere,
we can use our new centralized IP formatting functions.
This commit is contained in:
Matt Stancliff
2014-10-23 13:09:58 -04:00
parent 2d90619f88
commit 491881e13b
5 changed files with 12 additions and 33 deletions

View File

@ -1552,8 +1552,10 @@ int clusterProcessPacket(clusterLink *link) {
strcmp(ip,myself->ip))
{
memcpy(myself->ip,ip,REDIS_IP_STR_LEN);
anetFormatIP(ip, sizeof(ip), myself->ip, -1);
redisLog(REDIS_WARNING,"IP address for this node updated to %s",
myself->ip);
ip);
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
}
}