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
ee5a6df1
Commit
ee5a6df1
authored
Oct 17, 2012
by
Geoff Garside
Committed by
antirez
Jul 08, 2013
Browse files
Update calls to anetPeerToString to include ip_len.
parent
b39e827d
Changes
2
Show whitespace changes
Inline
Side-by-side
src/redis.c
View file @
ee5a6df1
...
@@ -2428,7 +2428,7 @@ sds genRedisInfoString(char *section) {
...
@@ -2428,7 +2428,7 @@ sds genRedisInfoString(char *section) {
int
port
;
int
port
;
long
lag
=
0
;
long
lag
=
0
;
if
(
anetPeerToString
(
slave
->
fd
,
ip
,
&
port
)
==
-
1
)
continue
;
if
(
anetPeerToString
(
slave
->
fd
,
ip
,
sizeof
(
ip
),
&
port
)
==
-
1
)
continue
;
switch
(
slave
->
replstate
)
{
switch
(
slave
->
replstate
)
{
case
REDIS_REPL_WAIT_BGSAVE_START
:
case
REDIS_REPL_WAIT_BGSAVE_START
:
case
REDIS_REPL_WAIT_BGSAVE_END
:
case
REDIS_REPL_WAIT_BGSAVE_END
:
...
...
src/replication.c
View file @
ee5a6df1
...
@@ -293,7 +293,7 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **
...
@@ -293,7 +293,7 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **
int
j
,
port
;
int
j
,
port
;
sds
cmdrepr
=
sdsnew
(
"+"
);
sds
cmdrepr
=
sdsnew
(
"+"
);
robj
*
cmdobj
;
robj
*
cmdobj
;
char
ip
[
32
];
char
ip
[
REDIS_IP_STR_LEN
];
struct
timeval
tv
;
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
gettimeofday
(
&
tv
,
NULL
);
...
@@ -303,7 +303,7 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **
...
@@ -303,7 +303,7 @@ 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
,
&
port
);
anetPeerToString
(
c
->
fd
,
ip
,
sizeof
(
ip
),
&
port
);
cmdrepr
=
sdscatprintf
(
cmdrepr
,
"[%d %s:%d] "
,
dictid
,
ip
,
port
);
cmdrepr
=
sdscatprintf
(
cmdrepr
,
"[%d %s:%d] "
,
dictid
,
ip
,
port
);
}
}
...
...
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