mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 01:01:22 +00:00
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:
@ -56,7 +56,7 @@ char *replicationGetSlaveName(redisClient *c) {
|
||||
buf[0] = '\0';
|
||||
if (anetPeerToString(c->fd,ip,sizeof(ip),NULL) != -1) {
|
||||
if (c->slave_listening_port)
|
||||
snprintf(buf,sizeof(buf),"%s:%d",ip,c->slave_listening_port);
|
||||
anetFormatIP(buf,sizeof(buf),ip,c->slave_listening_port);
|
||||
else
|
||||
snprintf(buf,sizeof(buf),"%s:<unknown-slave-port>",ip);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user