mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Log disconnection with slave only when ip:port is available.
This commit is contained in:
parent
2041882286
commit
fdf50e1e3d
@ -670,11 +670,11 @@ 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 */
|
||||||
sdsfree(c->querybuf);
|
sdsfree(c->querybuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user