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
115d076d
Commit
115d076d
authored
Nov 21, 2017
by
antirez
Browse files
Streams: fix lp-count field for non-same-fields entries.
parent
9bb18e54
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
115d076d
...
...
@@ -308,8 +308,12 @@ int streamAppendItem(stream *s, robj **argv, int numfields, streamID *added_id,
}
/* Compute and store the lp-count field. */
int
lp_count
=
numfields
;
if
(
!
(
flags
&
STREAM_ITEM_FLAG_SAMEFIELDS
))
lp_count
*=
2
;
lp_count
+=
3
;
/* Add the 3 fixed fileds flags + ms-diff + seq-diff. */
lp_count
+=
3
;
/* Add the 3 fixed fields flags + ms-diff + seq-diff. */
if
(
!
(
flags
&
STREAM_ITEM_FLAG_SAMEFIELDS
))
{
/* If the item is not compressed, it also has the fields other than
* the values, and an additional num-fileds field. */
lp_count
+=
numfields
+
1
;
}
lp
=
lpAppendInteger
(
lp
,
lp_count
);
/* Insert back into the tree in order to update the listpack pointer. */
...
...
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