summaryrefslogtreecommitdiff
path: root/src/networking.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-12-25 18:41:10 +0100
committerantirez <antirez@gmail.com>2013-12-25 18:41:53 +0100
commitfdf50e1e3dc3e9e3ce9bedd2b41b9fc5f0aab220 (patch)
treec4cc6fe5f0115fb7f8048fc79fb810175daa3e46 /src/networking.c
parent20418822867065cdbbeffc05a0bd0abae64284ff (diff)
downloadredis-fdf50e1e3dc3e9e3ce9bedd2b41b9fc5f0aab220.tar.gz
Log disconnection with slave only when ip:port is available.
Diffstat (limited to 'src/networking.c')
-rw-r--r--src/networking.c8
1 files 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 */