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
1a603e1a
Commit
1a603e1a
authored
Sep 12, 2017
by
antirez
Browse files
Streams: fix bug in XREAD last received ID processing.
parent
94af55c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
1a603e1a
...
...
@@ -524,9 +524,9 @@ void xreadCommand(client *c) {
/* Specifying "$" as last-known-id means that the client wants to be
* served with just the messages that will arrive into the stream
* starting from now. */
int
id_idx
=
i
-
streams_arg
-
streams_count
;
if
(
strcmp
(
c
->
argv
[
i
]
->
ptr
,
"$"
)
==
0
)
{
robj
*
o
=
lookupKeyRead
(
c
->
db
,
c
->
argv
[
i
-
streams_count
]);
int
id_idx
=
i
-
streams_arg
-
streams_count
;
if
(
o
)
{
stream
*
s
=
o
->
ptr
;
ids
[
id_idx
]
=
s
->
last_id
;
...
...
@@ -536,7 +536,8 @@ void xreadCommand(client *c) {
}
continue
;
}
if
(
streamParseIDOrReply
(
c
,
c
->
argv
[
i
],
ids
+
i
,
0
)
!=
C_OK
)
goto
cleanup
;
if
(
streamParseIDOrReply
(
c
,
c
->
argv
[
i
],
ids
+
id_idx
,
0
)
!=
C_OK
)
goto
cleanup
;
}
/* Try to serve the client synchronously. */
...
...
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