diff options
author | antirez <antirez@gmail.com> | 2013-12-25 18:41:10 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-12-25 18:41:53 +0100 |
commit | fdf50e1e3dc3e9e3ce9bedd2b41b9fc5f0aab220 (patch) | |
tree | c4cc6fe5f0115fb7f8048fc79fb810175daa3e46 /src/networking.c | |
parent | 20418822867065cdbbeffc05a0bd0abae64284ff (diff) | |
download | redis-fdf50e1e3dc3e9e3ce9bedd2b41b9fc5f0aab220.tar.gz |
Log disconnection with slave only when ip:port is available.
Diffstat (limited to 'src/networking.c')
-rw-r--r-- | src/networking.c | 8 |
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 */ |