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
76009949
Commit
76009949
authored
Apr 15, 2011
by
antirez
Browse files
Revert "variadic LPUSH/RPUSH backported to 2.2"
This reverts commit
c138dc7d
. Moving all the new stuff in 2.4 branch.
parent
6a9764d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
76009949
...
...
@@ -85,8 +85,8 @@ struct redisCommand readonlyCommandTable[] = {
{
"incr"
,
incrCommand
,
2
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"decr"
,
decrCommand
,
2
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"mget"
,
mgetCommand
,
-
2
,
0
,
NULL
,
1
,
-
1
,
1
},
{
"rpush"
,
rpushCommand
,
-
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"lpush"
,
lpushCommand
,
-
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"rpush"
,
rpushCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"lpush"
,
lpushCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"rpushx"
,
rpushxCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"lpushx"
,
lpushxCommand
,
3
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
{
"linsert"
,
linsertCommand
,
5
,
REDIS_CMD_DENYOOM
,
NULL
,
1
,
1
,
1
},
...
...
src/t_list.c
View file @
76009949
...
...
@@ -259,35 +259,30 @@ void listTypeConvert(robj *subject, int enc) {
*----------------------------------------------------------------------------*/
void
pushGenericCommand
(
redisClient
*
c
,
int
where
)
{
int
j
,
addlen
=
0
,
pushed
=
0
;
robj
*
lobj
=
lookupKeyWrite
(
c
->
db
,
c
->
argv
[
1
]);
int
may_have_waiting_clients
=
(
lobj
==
NULL
);
if
(
lobj
&&
lobj
->
type
!=
REDIS_LIST
)
{
addReply
(
c
,
shared
.
wrongtypeerr
);
return
;
}
for
(
j
=
2
;
j
<
c
->
argc
;
j
++
)
{
c
->
argv
[
j
]
=
tryObjectEncoding
(
c
->
argv
[
j
]);
if
(
may_have_waiting_clients
)
{
if
(
handleClientsWaitingListPush
(
c
,
c
->
argv
[
1
],
c
->
argv
[
j
]))
{
addlen
++
;
continue
;
}
else
{
may_have_waiting_clients
=
0
;
}
c
->
argv
[
2
]
=
tryObjectEncoding
(
c
->
argv
[
2
]);
if
(
lobj
==
NULL
)
{
if
(
handleClientsWaitingListPush
(
c
,
c
->
argv
[
1
],
c
->
argv
[
2
]))
{
addReply
(
c
,
shared
.
cone
);
return
;
}
if
(
!
lobj
)
{
lobj
=
createZiplistObject
();
dbAdd
(
c
->
db
,
c
->
argv
[
1
],
lobj
);
lobj
=
createZiplistObject
();
dbAdd
(
c
->
db
,
c
->
argv
[
1
],
lobj
);
}
else
{
if
(
lobj
->
type
!=
REDIS_LIST
)
{
addReply
(
c
,
shared
.
wrongtypeerr
);
return
;
}
if
(
handleClientsWaitingListPush
(
c
,
c
->
argv
[
1
],
c
->
argv
[
2
]))
{
touchWatchedKey
(
c
->
db
,
c
->
argv
[
1
]);
addReply
(
c
,
shared
.
cone
);
return
;
}
listTypePush
(
lobj
,
c
->
argv
[
j
],
where
);
pushed
++
;
}
addReplyLongLong
(
c
,
addlen
+
(
lobj
?
listTypeLength
(
lobj
)
:
0
));
if
(
pushed
)
touchWatchedKey
(
c
->
db
,
c
->
argv
[
1
]);
server
.
dirty
+=
pushed
;
listTypePush
(
lobj
,
c
->
argv
[
2
],
where
);
addReplyLongLong
(
c
,
listTypeLength
(
lobj
));
touchWatchedKey
(
c
->
db
,
c
->
argv
[
1
]);
server
.
dirty
++
;
}
void
lpushCommand
(
redisClient
*
c
)
{
...
...
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