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
ec9bbe96
Commit
ec9bbe96
authored
Sep 06, 2017
by
antirez
Browse files
Streams: XLEN command.
parent
98d184db
Changes
3
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
ec9bbe96
...
...
@@ -304,6 +304,7 @@ struct redisCommand redisCommandTable[] = {
{"pfdebug",pfdebugCommand,-3,"w",0,NULL,0,0,0,0,0},
{"xadd",xaddCommand,-4,"wmF",0,NULL,1,1,1,0,0},
{"xrange",xrangeCommand,-4,"r",0,NULL,1,1,1,0,0},
{"xlen",xlenCommand,2,"rF",0,NULL,1,1,1,0,0},
{"post",securityWarningCommand,-1,"lt",0,NULL,0,0,0,0,0},
{"host:",securityWarningCommand,-1,"lt",0,NULL,0,0,0,0,0},
{"latency",latencyCommand,-2,"aslt",0,NULL,0,0,0,0,0}
...
...
src/server.h
View file @
ec9bbe96
...
...
@@ -2001,6 +2001,7 @@ void moduleCommand(client *c);
void
securityWarningCommand
(
client
*
c
);
void
xaddCommand
(
client
*
c
);
void
xrangeCommand
(
client
*
c
);
void
xlenCommand
(
client
*
c
);
#if defined(__GNUC__)
void
*
calloc
(
size_t
count
,
size_t
size
)
__attribute__
((
deprecated
));
...
...
src/t_stream.c
View file @
ec9bbe96
...
...
@@ -378,3 +378,12 @@ void xrangeCommand(client *c) {
s
=
o
->
ptr
;
streamReplyWithRange
(
c
,
s
,
&
startid
,
&
endid
,
count
);
}
/* XLEN */
void
xlenCommand
(
client
*
c
)
{
robj
*
o
;
if
((
o
=
lookupKeyReadOrReply
(
c
,
c
->
argv
[
1
],
shared
.
czero
))
==
NULL
||
checkType
(
c
,
o
,
OBJ_STREAM
))
return
;
stream
*
s
=
o
->
ptr
;
addReplyLongLong
(
c
,
s
->
length
);
}
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