Commit 0a1a236e authored by antirez's avatar antirez
Browse files

Log disconnection with slave only when ip:port is available.

parent 27d06111
...@@ -653,10 +653,10 @@ void freeClient(redisClient *c) { ...@@ -653,10 +653,10 @@ void freeClient(redisClient *c) {
if (c->flags & REDIS_SLAVE) { if (c->flags & REDIS_SLAVE) {
char ip[REDIS_IP_STR_LEN]; char ip[REDIS_IP_STR_LEN];
if (anetPeerToString(c->fd,ip,sizeof(ip),NULL) == -1) if (anetPeerToString(c->fd,ip,sizeof(ip),NULL) != -1) {
strncpy(ip,"?",REDIS_IP_STR_LEN); redisLog(REDIS_WARNING,"Connection with slave %s:%d lost.",
redisLog(REDIS_WARNING,"Connection with slave %s:%d lost.", ip, c->slave_listening_port);
ip, c->slave_listening_port); }
} }
/* Free the query buffer */ /* Free the query buffer */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment