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
13741fb9
Unverified
Commit
13741fb9
authored
Feb 06, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Feb 06, 2020
Browse files
Merge pull request #6846 from oranagra/module_client_flags
Fix client flags to be int64 in module.c
parents
08b218bf
d454d5a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
13741fb9
...
@@ -714,9 +714,9 @@ void RM_KeyAtPos(RedisModuleCtx *ctx, int pos) {
...
@@ -714,9 +714,9 @@ void RM_KeyAtPos(RedisModuleCtx *ctx, int pos) {
* flags into the command flags used by the Redis core.
* flags into the command flags used by the Redis core.
*
*
* It returns the set of flags, or -1 if unknown flags are found. */
* It returns the set of flags, or -1 if unknown flags are found. */
int
commandFlagsFromString
(
char
*
s
)
{
int
64_t
commandFlagsFromString
(
char
*
s
)
{
int
count
,
j
;
int
count
,
j
;
int
flags
=
0
;
int
64_t
flags
=
0
;
sds
*
tokens
=
sdssplitlen
(
s
,
strlen
(
s
),
" "
,
1
,
&
count
);
sds
*
tokens
=
sdssplitlen
(
s
,
strlen
(
s
),
" "
,
1
,
&
count
);
for
(
j
=
0
;
j
<
count
;
j
++
)
{
for
(
j
=
0
;
j
<
count
;
j
++
)
{
char
*
t
=
tokens
[
j
];
char
*
t
=
tokens
[
j
];
...
@@ -798,7 +798,7 @@ int commandFlagsFromString(char *s) {
...
@@ -798,7 +798,7 @@ int commandFlagsFromString(char *s) {
* to authenticate a client.
* to authenticate a client.
*/
*/
int
RM_CreateCommand
(
RedisModuleCtx
*
ctx
,
const
char
*
name
,
RedisModuleCmdFunc
cmdfunc
,
const
char
*
strflags
,
int
firstkey
,
int
lastkey
,
int
keystep
)
{
int
RM_CreateCommand
(
RedisModuleCtx
*
ctx
,
const
char
*
name
,
RedisModuleCmdFunc
cmdfunc
,
const
char
*
strflags
,
int
firstkey
,
int
lastkey
,
int
keystep
)
{
int
flags
=
strflags
?
commandFlagsFromString
((
char
*
)
strflags
)
:
0
;
int
64_t
flags
=
strflags
?
commandFlagsFromString
((
char
*
)
strflags
)
:
0
;
if
(
flags
==
-
1
)
return
REDISMODULE_ERR
;
if
(
flags
==
-
1
)
return
REDISMODULE_ERR
;
if
((
flags
&
CMD_MODULE_NO_CLUSTER
)
&&
server
.
cluster_enabled
)
if
((
flags
&
CMD_MODULE_NO_CLUSTER
)
&&
server
.
cluster_enabled
)
return
REDISMODULE_ERR
;
return
REDISMODULE_ERR
;
...
...
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