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
60df7dbe
Commit
60df7dbe
authored
Jun 25, 2018
by
antirez
Browse files
Sentinel command renaming: rename-command option parsing.
parent
72e8a33b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
60df7dbe
...
@@ -1713,6 +1713,17 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
...
@@ -1713,6 +1713,17 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
si
->
runid
=
sdsnew
(
argv
[
4
]);
si
->
runid
=
sdsnew
(
argv
[
4
]);
sentinelTryConnectionSharing
(
si
);
sentinelTryConnectionSharing
(
si
);
}
}
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"rename-command"
)
&&
argc
==
4
)
{
/* rename-command <name> <command> <renamed-command> */
ri
=
sentinelGetMasterByName
(
argv
[
1
]);
if
(
!
ri
)
return
"No such master with specified name."
;
sds
oldcmd
=
sdsnew
(
argv
[
2
]);
sds
newcmd
=
sdsnew
(
argv
[
3
]);
if
(
dictAdd
(
ri
->
renamed_commands
,
oldcmd
,
newcmd
)
!=
DICT_OK
)
{
sdsfree
(
oldcmd
);
sdsfree
(
newcmd
);
return
"Same command renamed multiple times with rename-command."
;
}
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"announce-ip"
)
&&
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"announce-ip"
)
&&
argc
==
2
)
{
/* announce-ip <ip-address> */
/* announce-ip <ip-address> */
if
(
strlen
(
argv
[
1
]))
if
(
strlen
(
argv
[
1
]))
...
...
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