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
631d656a
Commit
631d656a
authored
Jul 09, 2013
by
antirez
Browse files
All IP string repr buffers are now REDIS_IP_STR_LEN bytes.
parent
f19e267e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
631d656a
...
...
@@ -306,7 +306,7 @@ void freeClusterLink(clusterLink *link) {
void
clusterAcceptHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
)
{
int
cport
,
cfd
;
char
cip
[
128
];
/* Could use INET6_ADDR
STRLEN
here, but its smaller */
char
cip
[
REDIS_IP_
STR
_
LEN
];
clusterLink
*
link
;
REDIS_NOTUSED
(
el
);
REDIS_NOTUSED
(
mask
);
...
...
src/networking.c
View file @
631d656a
...
...
@@ -552,7 +552,7 @@ static void acceptCommonHandler(int fd, int flags) {
void
acceptTcpHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
)
{
int
cport
,
cfd
;
char
cip
[
128
];
/* Could use INET6_ADDR
STRLEN
here, but its smaller */
char
cip
[
REDIS_IP_
STR
_
LEN
];
REDIS_NOTUSED
(
el
);
REDIS_NOTUSED
(
mask
);
REDIS_NOTUSED
(
privdata
);
...
...
@@ -1210,8 +1210,7 @@ void clientCommand(redisClient *c) {
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"kill"
)
&&
c
->
argc
==
3
)
{
listRewind
(
server
.
clients
,
&
li
);
while
((
ln
=
listNext
(
&
li
))
!=
NULL
)
{
/* addr size 64 > INET6_ADDRSTRLEN + : + strlen("65535") */
char
ip
[
INET6_ADDRSTRLEN
],
addr
[
64
];
char
ip
[
REDIS_IP_STR_LEN
],
addr
[
REDIS_IP_STR_LEN
+
64
];
int
port
;
client
=
listNodeValue
(
ln
);
...
...
src/redis.c
View file @
631d656a
...
...
@@ -2435,7 +2435,7 @@ sds genRedisInfoString(char *section) {
while
((
ln
=
listNext
(
&
li
)))
{
redisClient
*
slave
=
listNodeValue
(
ln
);
char
*
state
=
NULL
;
char
ip
[
INET6_ADDR
STRLEN
];
char
ip
[
REDIS_IP_
STR
_
LEN
];
int
port
;
long
lag
=
0
;
...
...
src/sentinel.c
View file @
631d656a
...
...
@@ -1837,7 +1837,7 @@ void sentinelPingInstance(sentinelRedisInstance *ri) {
(
now
-
ri
->
last_pub_time
)
>
SENTINEL_PUBLISH_PERIOD
)
{
/* PUBLISH hello messages only to masters. */
char
ip
[
INET6_ADDR
STRLEN
];
char
ip
[
REDIS_IP_
STR
_
LEN
];
if
(
anetSockName
(
ri
->
cc
->
c
.
fd
,
ip
,
sizeof
(
ip
),
NULL
)
!=
-
1
)
{
char
myaddr
[
128
];
...
...
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