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
e1ab2991
Commit
e1ab2991
authored
Jan 08, 2014
by
antirez
Browse files
Fix keyspace events flags-to-string conversion.
Fixes issue #1491 on Github.
parent
a2f99478
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/notify.c
View file @
e1ab2991
...
...
@@ -67,17 +67,19 @@ int keyspaceEventsStringToFlags(char *classes) {
sds
keyspaceEventsFlagsToString
(
int
flags
)
{
sds
res
;
if
((
flags
&
REDIS_NOTIFY_ALL
)
==
REDIS_NOTIFY_ALL
)
return
sdsnew
(
"A"
);
res
=
sdsempty
();
if
(
flags
&
REDIS_NOTIFY_GENERIC
)
res
=
sdscatlen
(
res
,
"g"
,
1
);
if
(
flags
&
REDIS_NOTIFY_STRING
)
res
=
sdscatlen
(
res
,
"$"
,
1
);
if
(
flags
&
REDIS_NOTIFY_LIST
)
res
=
sdscatlen
(
res
,
"l"
,
1
);
if
(
flags
&
REDIS_NOTIFY_SET
)
res
=
sdscatlen
(
res
,
"s"
,
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_ALL
)
==
REDIS_NOTIFY_ALL
)
{
res
=
sdscatlen
(
res
,
"A"
,
1
);
}
else
{
if
(
flags
&
REDIS_NOTIFY_GENERIC
)
res
=
sdscatlen
(
res
,
"g"
,
1
);
if
(
flags
&
REDIS_NOTIFY_STRING
)
res
=
sdscatlen
(
res
,
"$"
,
1
);
if
(
flags
&
REDIS_NOTIFY_LIST
)
res
=
sdscatlen
(
res
,
"l"
,
1
);
if
(
flags
&
REDIS_NOTIFY_SET
)
res
=
sdscatlen
(
res
,
"s"
,
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_KEYEVENT
)
res
=
sdscatlen
(
res
,
"E"
,
1
);
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