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
fe2fdef7
Unverified
Commit
fe2fdef7
authored
Jan 10, 2021
by
sundb
Committed by
GitHub
Jan 09, 2021
Browse files
Assert that clusterAddNode can't fail (#8296)
Assert that clusterAddNode can't fail
parent
430dadaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
fe2fdef7
...
...
@@ -47,7 +47,7 @@
clusterNode
*
myself
=
NULL
;
clusterNode
*
createClusterNode
(
char
*
nodename
,
int
flags
);
int
clusterAddNode
(
clusterNode
*
node
);
void
clusterAddNode
(
clusterNode
*
node
);
void
clusterAcceptHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
clusterReadHandler
(
connection
*
conn
);
void
clusterSendPing
(
clusterLink
*
link
,
int
type
);
...
...
@@ -961,12 +961,12 @@ void freeClusterNode(clusterNode *n) {
}
/* Add a node to the nodes hash table */
int
clusterAddNode
(
clusterNode
*
node
)
{
void
clusterAddNode
(
clusterNode
*
node
)
{
int
retval
;
retval
=
dictAdd
(
server
.
cluster
->
nodes
,
sdsnewlen
(
node
->
name
,
CLUSTER_NAMELEN
),
node
);
return
(
retval
==
DICT_OK
)
?
C_OK
:
C_ERR
;
serverAssert
(
retval
==
DICT_OK
);
}
/* Remove a node from the cluster. The function performs the high level
...
...
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