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
b190b0c9
Commit
b190b0c9
authored
May 27, 2011
by
antirez
Browse files
modified the BRPOPLPUSH target field cleanup strategy to fix it the proper way.
parent
d7061f81
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_list.c
View file @
b190b0c9
...
@@ -865,6 +865,9 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
...
@@ -865,6 +865,9 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
receiver
=
ln
->
value
;
receiver
=
ln
->
value
;
dstkey
=
receiver
->
bpop
.
target
;
dstkey
=
receiver
->
bpop
.
target
;
/* Protect receiver->bpop.target, that will be freed by
* the next unblockClientWaitingData() call. */
if
(
dstkey
)
incrRefCount
(
dstkey
);
/* This should remove the first element of the "clients" list. */
/* This should remove the first element of the "clients" list. */
unblockClientWaitingData
(
receiver
);
unblockClientWaitingData
(
receiver
);
...
@@ -877,13 +880,12 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
...
@@ -877,13 +880,12 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
}
else
{
}
else
{
/* BRPOPLPUSH, note that receiver->db is always equal to c->db. */
/* BRPOPLPUSH, note that receiver->db is always equal to c->db. */
dstobj
=
lookupKeyWrite
(
receiver
->
db
,
dstkey
);
dstobj
=
lookupKeyWrite
(
receiver
->
db
,
dstkey
);
if
(
dstobj
&&
checkType
(
receiver
,
dstobj
,
REDIS_LIST
))
{
if
(
!
(
dstobj
&&
checkType
(
receiver
,
dstobj
,
REDIS_LIST
)))
{
decrRefCount
(
dstkey
);
}
else
{
rpoplpushHandlePush
(
c
,
receiver
,
dstkey
,
dstobj
,
ele
);
rpoplpushHandlePush
(
c
,
receiver
,
dstkey
,
dstobj
,
ele
);
decrRefCount
(
dstkey
);
decrRefCount
(
dstkey
);
return
1
;
return
1
;
}
}
decrRefCount
(
dstkey
);
}
}
}
}
...
...
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