提交 ba5eb44d 编写于 作者: A antirez

Slave disconnection is an event worth logging.

上级 66ec1412
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册