Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
cdf801d9
Commit
cdf801d9
authored
Jul 09, 2013
by
antirez
Browse files
Use getClientPeerId() for MONITOR implementation.
parent
3472d045
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
cdf801d9
...
...
@@ -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
i
p
[
REDIS_
IP_STR
_LEN
];
char
p
eerid
[
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
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment