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
38729126
Commit
38729126
authored
Jan 08, 2020
by
antirez
Browse files
XCLAIM: Create the consumer only on successful claims.
Fixes #6744.
parent
b9a15303
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
38729126
...
@@ -2246,7 +2246,7 @@ void xclaimCommand(client *c) {
...
@@ -2246,7 +2246,7 @@ void xclaimCommand(client *c) {
}
}
/* Do the actual claiming. */
/* Do the actual claiming. */
streamConsumer
*
consumer
=
streamLookupConsumer
(
group
,
c
->
argv
[
3
]
->
ptr
,
1
)
;
streamConsumer
*
consumer
=
NULL
;
void
*
arraylenptr
=
addReplyDeferredLen
(
c
);
void
*
arraylenptr
=
addReplyDeferredLen
(
c
);
size_t
arraylen
=
0
;
size_t
arraylen
=
0
;
for
(
int
j
=
5
;
j
<=
last_id_arg
;
j
++
)
{
for
(
int
j
=
5
;
j
<=
last_id_arg
;
j
++
)
{
...
@@ -2298,9 +2298,11 @@ void xclaimCommand(client *c) {
...
@@ -2298,9 +2298,11 @@ void xclaimCommand(client *c) {
if
(
nack
->
consumer
)
if
(
nack
->
consumer
)
raxRemove
(
nack
->
consumer
->
pel
,
buf
,
sizeof
(
buf
),
NULL
);
raxRemove
(
nack
->
consumer
->
pel
,
buf
,
sizeof
(
buf
),
NULL
);
/* Update the consumer and idle time. */
/* Update the consumer and idle time. */
if
(
consumer
==
NULL
)
consumer
=
streamLookupConsumer
(
group
,
c
->
argv
[
3
]
->
ptr
,
1
);
nack
->
consumer
=
consumer
;
nack
->
consumer
=
consumer
;
nack
->
delivery_time
=
deliverytime
;
nack
->
delivery_time
=
deliverytime
;
/* Set the delivery attempts counter if given, otherwise
/* Set the delivery attempts counter if given, otherwise
* autoincrement unless JUSTID option provided */
* autoincrement unless JUSTID option provided */
if
(
retrycount
>=
0
)
{
if
(
retrycount
>=
0
)
{
nack
->
delivery_count
=
retrycount
;
nack
->
delivery_count
=
retrycount
;
...
...
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