From fdf50e1e3dc3e9e3ce9bedd2b41b9fc5f0aab220 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 25 Dec 2013 18:41:10 +0100 Subject: [PATCH] Log disconnection with slave only when ip:port is available. --- src/networking.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/networking.c b/src/networking.c index f2913cf0c..ff3681f52 100644 --- a/src/networking.c +++ b/src/networking.c @@ -670,10 +670,10 @@ void freeClient(redisClient *c) { if (c->flags & REDIS_SLAVE) { char ip[REDIS_IP_STR_LEN]; - if (anetPeerToString(c->fd,ip,sizeof(ip),NULL) == -1) - strncpy(ip,"?",REDIS_IP_STR_LEN); - redisLog(REDIS_WARNING,"Connection with slave %s:%d lost.", - ip, c->slave_listening_port); + if (anetPeerToString(c->fd,ip,sizeof(ip),NULL) != -1) { + redisLog(REDIS_WARNING,"Connection with slave %s:%d lost.", + ip, c->slave_listening_port); + } } /* Free the query buffer */