diff --git a/src/networking.c b/src/networking.c index 0661137d77391d50db5a1612680478db84f35717..f2913cf0cc661f6ed3c5dfc99c44a588616b45cf 100644 --- a/src/networking.c +++ b/src/networking.c @@ -666,6 +666,16 @@ void freeClient(redisClient *c) { } } + /* Log link disconnection with slave */ + 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); + } + /* Free the query buffer */ sdsfree(c->querybuf); c->querybuf = NULL;