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
51f71e2d
You need to sign in or sign up before continuing.
Commit
51f71e2d
authored
Jan 08, 2014
by
antirez
Browse files
Fix keyspace events flags-to-string conversion.
Fixes issue #1491 on Github.
parent
05d219a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/notify.c
View file @
51f71e2d
...
@@ -67,17 +67,19 @@ int keyspaceEventsStringToFlags(char *classes) {
...
@@ -67,17 +67,19 @@ int keyspaceEventsStringToFlags(char *classes) {
sds
keyspaceEventsFlagsToString
(
int
flags
)
{
sds
keyspaceEventsFlagsToString
(
int
flags
)
{
sds
res
;
sds
res
;
if
((
flags
&
REDIS_NOTIFY_ALL
)
==
REDIS_NOTIFY_ALL
)
return
sdsnew
(
"A"
);
res
=
sdsempty
();
res
=
sdsempty
();
if
(
flags
&
REDIS_NOTIFY_GENERIC
)
res
=
sdscatlen
(
res
,
"g"
,
1
);
if
((
flags
&
REDIS_NOTIFY_ALL
)
==
REDIS_NOTIFY_ALL
)
{
if
(
flags
&
REDIS_NOTIFY_STRING
)
res
=
sdscatlen
(
res
,
"$"
,
1
);
res
=
sdscatlen
(
res
,
"A"
,
1
);
if
(
flags
&
REDIS_NOTIFY_LIST
)
res
=
sdscatlen
(
res
,
"l"
,
1
);
}
else
{
if
(
flags
&
REDIS_NOTIFY_SET
)
res
=
sdscatlen
(
res
,
"s"
,
1
);
if
(
flags
&
REDIS_NOTIFY_GENERIC
)
res
=
sdscatlen
(
res
,
"g"
,
1
);
if
(
flags
&
REDIS_NOTIFY_HASH
)
res
=
sdscatlen
(
res
,
"h"
,
1
);
if
(
flags
&
REDIS_NOTIFY_STRING
)
res
=
sdscatlen
(
res
,
"$"
,
1
);
if
(
flags
&
REDIS_NOTIFY_ZSET
)
res
=
sdscatlen
(
res
,
"z"
,
1
);
if
(
flags
&
REDIS_NOTIFY_LIST
)
res
=
sdscatlen
(
res
,
"l"
,
1
);
if
(
flags
&
REDIS_NOTIFY_EXPIRED
)
res
=
sdscatlen
(
res
,
"x"
,
1
);
if
(
flags
&
REDIS_NOTIFY_SET
)
res
=
sdscatlen
(
res
,
"s"
,
1
);
if
(
flags
&
REDIS_NOTIFY_EVICTED
)
res
=
sdscatlen
(
res
,
"e"
,
1
);
if
(
flags
&
REDIS_NOTIFY_HASH
)
res
=
sdscatlen
(
res
,
"h"
,
1
);
if
(
flags
&
REDIS_NOTIFY_ZSET
)
res
=
sdscatlen
(
res
,
"z"
,
1
);
if
(
flags
&
REDIS_NOTIFY_EXPIRED
)
res
=
sdscatlen
(
res
,
"x"
,
1
);
if
(
flags
&
REDIS_NOTIFY_EVICTED
)
res
=
sdscatlen
(
res
,
"e"
,
1
);
}
if
(
flags
&
REDIS_NOTIFY_KEYSPACE
)
res
=
sdscatlen
(
res
,
"K"
,
1
);
if
(
flags
&
REDIS_NOTIFY_KEYSPACE
)
res
=
sdscatlen
(
res
,
"K"
,
1
);
if
(
flags
&
REDIS_NOTIFY_KEYEVENT
)
res
=
sdscatlen
(
res
,
"E"
,
1
);
if
(
flags
&
REDIS_NOTIFY_KEYEVENT
)
res
=
sdscatlen
(
res
,
"E"
,
1
);
return
res
;
return
res
;
...
...
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