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
38c06fa0
Commit
38c06fa0
authored
Dec 07, 2011
by
antirez
Browse files
List type AOF rewrite using variadic RPUSH for the linked list encoding.
parent
5b250096
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
38c06fa0
...
@@ -460,10 +460,16 @@ int rewriteListObject(rio *r, robj *key, robj *o) {
...
@@ -460,10 +460,16 @@ int rewriteListObject(rio *r, robj *key, robj *o) {
while
((
ln
=
listNext
(
&
li
)))
{
while
((
ln
=
listNext
(
&
li
)))
{
robj
*
eleobj
=
listNodeValue
(
ln
);
robj
*
eleobj
=
listNodeValue
(
ln
);
if
(
rioWriteBulkCount
(
r
,
'*'
,
3
)
==
0
)
return
0
;
if
(
count
==
0
)
{
if
(
rioWriteBulkString
(
r
,
"RPUSH"
,
5
)
==
0
)
return
0
;
int
cmd_items
=
(
items
>
REDIS_AOFREWRITE_ITEMS_PER_CMD
)
?
if
(
rioWriteBulkObject
(
r
,
key
)
==
0
)
return
0
;
REDIS_AOFREWRITE_ITEMS_PER_CMD
:
items
;
if
(
rioWriteBulkCount
(
r
,
'*'
,
2
+
cmd_items
)
==
0
)
return
0
;
if
(
rioWriteBulkString
(
r
,
"RPUSH"
,
5
)
==
0
)
return
0
;
if
(
rioWriteBulkObject
(
r
,
key
)
==
0
)
return
0
;
}
if
(
rioWriteBulkObject
(
r
,
eleobj
)
==
0
)
return
0
;
if
(
rioWriteBulkObject
(
r
,
eleobj
)
==
0
)
return
0
;
if
(
++
count
==
REDIS_AOFREWRITE_ITEMS_PER_CMD
)
count
=
0
;
items
--
;
}
}
}
else
{
}
else
{
redisPanic
(
"Unknown list encoding"
);
redisPanic
(
"Unknown list encoding"
);
...
...
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