mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Log disconnection with slave only when ip:port is available.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user