mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Use getClientPeerId() for MONITOR implementation.
This commit is contained in:
parent
d0001fe810
commit
d1cbad6d14
@ -290,10 +290,10 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
|
|||||||
void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **argv, int argc) {
|
void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **argv, int argc) {
|
||||||
listNode *ln;
|
listNode *ln;
|
||||||
listIter li;
|
listIter li;
|
||||||
int j, port;
|
int j;
|
||||||
sds cmdrepr = sdsnew("+");
|
sds cmdrepr = sdsnew("+");
|
||||||
robj *cmdobj;
|
robj *cmdobj;
|
||||||
char ip[REDIS_IP_STR_LEN];
|
char peerid[REDIS_PEER_ID_LEN];
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
gettimeofday(&tv,NULL);
|
gettimeofday(&tv,NULL);
|
||||||
@ -303,8 +303,8 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **
|
|||||||
} else if (c->flags & REDIS_UNIX_SOCKET) {
|
} else if (c->flags & REDIS_UNIX_SOCKET) {
|
||||||
cmdrepr = sdscatprintf(cmdrepr,"[%d unix:%s] ",dictid,server.unixsocket);
|
cmdrepr = sdscatprintf(cmdrepr,"[%d unix:%s] ",dictid,server.unixsocket);
|
||||||
} else {
|
} else {
|
||||||
anetPeerToString(c->fd,ip,sizeof(ip),&port);
|
getClientPeerId(c,peerid,sizeof(peerid));
|
||||||
cmdrepr = sdscatprintf(cmdrepr,"[%d %s:%d] ",dictid,ip,port);
|
cmdrepr = sdscatprintf(cmdrepr,"[%d %s] ",dictid,peerid);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < argc; j++) {
|
for (j = 0; j < argc; j++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user