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
df00b6ac
Commit
df00b6ac
authored
Jan 13, 2014
by
antirez
Browse files
SENTINEL SET: error on bad option name + flush config on error.
parent
b8db8a0c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
df00b6ac
...
@@ -2646,6 +2646,7 @@ void sentinelSetCommand(redisClient *c) {
...
@@ -2646,6 +2646,7 @@ void sentinelSetCommand(redisClient *c) {
if (strlen(value) && access(value,X_OK) == -1) {
if (strlen(value) && access(value,X_OK) == -1) {
addReplyError(c,
addReplyError(c,
"Notification script seems non existing or non executable");
"Notification script seems non existing or non executable");
if (changes) sentinelFlushConfig();
return;
return;
}
}
sdsfree(ri->notification_script);
sdsfree(ri->notification_script);
...
@@ -2657,6 +2658,7 @@ void sentinelSetCommand(redisClient *c) {
...
@@ -2657,6 +2658,7 @@ void sentinelSetCommand(redisClient *c) {
addReplyError(c,
addReplyError(c,
"Client reconfiguration script seems non existing or "
"Client reconfiguration script seems non existing or "
"non executable");
"non executable");
if (changes) sentinelFlushConfig();
return;
return;
}
}
sdsfree(ri->client_reconfig_script);
sdsfree(ri->client_reconfig_script);
...
@@ -2667,6 +2669,11 @@ void sentinelSetCommand(redisClient *c) {
...
@@ -2667,6 +2669,11 @@ void sentinelSetCommand(redisClient *c) {
sdsfree(ri->auth_pass);
sdsfree(ri->auth_pass);
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
changes++;
changes++;
} else {
addReplyErrorFormat(c,"Unknown option '%s' for SENTINEL SET",
option);
if (changes) sentinelFlushConfig();
return;
}
}
}
}
...
...
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