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
b2cc8bcc
Commit
b2cc8bcc
authored
Jul 04, 2016
by
antirez
Browse files
CONFIG GET is now no longer case sensitive.
Like CONFIG SET always was. Close #3369.
parent
a0dd0140
Changes
1
Show whitespace changes
Inline
Side-by-side
src/config.c
View file @
b2cc8bcc
...
@@ -1067,7 +1067,7 @@ badfmt: /* Bad format errors */
...
@@ -1067,7 +1067,7 @@ badfmt: /* Bad format errors */
*----------------------------------------------------------------------------*/
*----------------------------------------------------------------------------*/
#define config_get_string_field(_name,_var) do { \
#define config_get_string_field(_name,_var) do { \
if (stringmatch(pattern,_name,
0
)) { \
if (stringmatch(pattern,_name,
1
)) { \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,_var ? _var : ""); \
addReplyBulkCString(c,_var ? _var : ""); \
matches++; \
matches++; \
...
@@ -1075,7 +1075,7 @@ badfmt: /* Bad format errors */
...
@@ -1075,7 +1075,7 @@ badfmt: /* Bad format errors */
} while(0);
} while(0);
#define config_get_bool_field(_name,_var) do { \
#define config_get_bool_field(_name,_var) do { \
if (stringmatch(pattern,_name,
0
)) { \
if (stringmatch(pattern,_name,
1
)) { \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,_var ? "yes" : "no"); \
addReplyBulkCString(c,_var ? "yes" : "no"); \
matches++; \
matches++; \
...
@@ -1083,7 +1083,7 @@ badfmt: /* Bad format errors */
...
@@ -1083,7 +1083,7 @@ badfmt: /* Bad format errors */
} while(0);
} while(0);
#define config_get_numerical_field(_name,_var) do { \
#define config_get_numerical_field(_name,_var) do { \
if (stringmatch(pattern,_name,
0
)) { \
if (stringmatch(pattern,_name,
1
)) { \
ll2string(buf,sizeof(buf),_var); \
ll2string(buf,sizeof(buf),_var); \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,buf); \
addReplyBulkCString(c,buf); \
...
@@ -1092,7 +1092,7 @@ badfmt: /* Bad format errors */
...
@@ -1092,7 +1092,7 @@ badfmt: /* Bad format errors */
} while(0);
} while(0);
#define config_get_enum_field(_name,_var,_enumvar) do { \
#define config_get_enum_field(_name,_var,_enumvar) do { \
if (stringmatch(pattern,_name,
0
)) { \
if (stringmatch(pattern,_name,
1
)) { \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,_name); \
addReplyBulkCString(c,configEnumGetNameOrUnknown(_enumvar,_var)); \
addReplyBulkCString(c,configEnumGetNameOrUnknown(_enumvar,_var)); \
matches++; \
matches++; \
...
@@ -1215,12 +1215,12 @@ void configGetCommand(client *c) {
...
@@ -1215,12 +1215,12 @@ void configGetCommand(client *c) {
/* Everything we can't handle with macros follows. */
/* Everything we can't handle with macros follows. */
if
(
stringmatch
(
pattern
,
"appendonly"
,
0
))
{
if
(
stringmatch
(
pattern
,
"appendonly"
,
1
))
{
addReplyBulkCString
(
c
,
"appendonly"
);
addReplyBulkCString
(
c
,
"appendonly"
);
addReplyBulkCString
(
c
,
server
.
aof_state
==
AOF_OFF
?
"no"
:
"yes"
);
addReplyBulkCString
(
c
,
server
.
aof_state
==
AOF_OFF
?
"no"
:
"yes"
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"dir"
,
0
))
{
if
(
stringmatch
(
pattern
,
"dir"
,
1
))
{
char
buf
[
1024
];
char
buf
[
1024
];
if
(
getcwd
(
buf
,
sizeof
(
buf
))
==
NULL
)
if
(
getcwd
(
buf
,
sizeof
(
buf
))
==
NULL
)
...
@@ -1230,7 +1230,7 @@ void configGetCommand(client *c) {
...
@@ -1230,7 +1230,7 @@ void configGetCommand(client *c) {
addReplyBulkCString
(
c
,
buf
);
addReplyBulkCString
(
c
,
buf
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"save"
,
0
))
{
if
(
stringmatch
(
pattern
,
"save"
,
1
))
{
sds
buf
=
sdsempty
();
sds
buf
=
sdsempty
();
int
j
;
int
j
;
...
@@ -1246,7 +1246,7 @@ void configGetCommand(client *c) {
...
@@ -1246,7 +1246,7 @@ void configGetCommand(client *c) {
sdsfree
(
buf
);
sdsfree
(
buf
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"client-output-buffer-limit"
,
0
))
{
if
(
stringmatch
(
pattern
,
"client-output-buffer-limit"
,
1
))
{
sds
buf
=
sdsempty
();
sds
buf
=
sdsempty
();
int
j
;
int
j
;
...
@@ -1264,14 +1264,14 @@ void configGetCommand(client *c) {
...
@@ -1264,14 +1264,14 @@ void configGetCommand(client *c) {
sdsfree
(
buf
);
sdsfree
(
buf
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"unixsocketperm"
,
0
))
{
if
(
stringmatch
(
pattern
,
"unixsocketperm"
,
1
))
{
char
buf
[
32
];
char
buf
[
32
];
snprintf
(
buf
,
sizeof
(
buf
),
"%o"
,
server
.
unixsocketperm
);
snprintf
(
buf
,
sizeof
(
buf
),
"%o"
,
server
.
unixsocketperm
);
addReplyBulkCString
(
c
,
"unixsocketperm"
);
addReplyBulkCString
(
c
,
"unixsocketperm"
);
addReplyBulkCString
(
c
,
buf
);
addReplyBulkCString
(
c
,
buf
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"slaveof"
,
0
))
{
if
(
stringmatch
(
pattern
,
"slaveof"
,
1
))
{
char
buf
[
256
];
char
buf
[
256
];
addReplyBulkCString
(
c
,
"slaveof"
);
addReplyBulkCString
(
c
,
"slaveof"
);
...
@@ -1283,7 +1283,7 @@ void configGetCommand(client *c) {
...
@@ -1283,7 +1283,7 @@ void configGetCommand(client *c) {
addReplyBulkCString
(
c
,
buf
);
addReplyBulkCString
(
c
,
buf
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"notify-keyspace-events"
,
0
))
{
if
(
stringmatch
(
pattern
,
"notify-keyspace-events"
,
1
))
{
robj
*
flagsobj
=
createObject
(
OBJ_STRING
,
robj
*
flagsobj
=
createObject
(
OBJ_STRING
,
keyspaceEventsFlagsToString
(
server
.
notify_keyspace_events
));
keyspaceEventsFlagsToString
(
server
.
notify_keyspace_events
));
...
@@ -1292,7 +1292,7 @@ void configGetCommand(client *c) {
...
@@ -1292,7 +1292,7 @@ void configGetCommand(client *c) {
decrRefCount
(
flagsobj
);
decrRefCount
(
flagsobj
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"bind"
,
0
))
{
if
(
stringmatch
(
pattern
,
"bind"
,
1
))
{
sds
aux
=
sdsjoin
(
server
.
bindaddr
,
server
.
bindaddr_count
,
" "
);
sds
aux
=
sdsjoin
(
server
.
bindaddr
,
server
.
bindaddr_count
,
" "
);
addReplyBulkCString
(
c
,
"bind"
);
addReplyBulkCString
(
c
,
"bind"
);
...
...
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