diff options
author | antirez <antirez@gmail.com> | 2013-07-09 16:21:21 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-07-09 16:21:21 +0200 |
commit | d1cbad6d1404c62d90921280f5d180bb5d67f097 (patch) | |
tree | 7f16bdff495250663fa6a10a1a74e519f6d1935a | |
parent | d0001fe810150edbbf25e188e949d7de494c9327 (diff) | |
download | redis-d1cbad6d1404c62d90921280f5d180bb5d67f097.tar.gz |
Use getClientPeerId() for MONITOR implementation.
-rw-r--r-- | src/replication.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/replication.c b/src/replication.c index 4dce2cdcb..f82c32a8f 100644 --- a/src/replication.c +++ b/src/replication.c @@ -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) { listNode *ln; listIter li; - int j, port; + int j; sds cmdrepr = sdsnew("+"); robj *cmdobj; - char ip[REDIS_IP_STR_LEN]; + char peerid[REDIS_PEER_ID_LEN]; struct timeval tv; gettimeofday(&tv,NULL); @@ -303,8 +303,8 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj ** } else if (c->flags & REDIS_UNIX_SOCKET) { cmdrepr = sdscatprintf(cmdrepr,"[%d unix:%s] ",dictid,server.unixsocket); } else { - anetPeerToString(c->fd,ip,sizeof(ip),&port); - cmdrepr = sdscatprintf(cmdrepr,"[%d %s:%d] ",dictid,ip,port); + getClientPeerId(c,peerid,sizeof(peerid)); + cmdrepr = sdscatprintf(cmdrepr,"[%d %s] ",dictid,peerid); } for (j = 0; j < argc; j++) { |