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
6c7847a1
Unverified
Commit
6c7847a1
authored
Jun 14, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 14, 2018
Browse files
Merge pull request #5018 from soloestoy/optimize-reply
optimize reply list memory usage
parents
1e92fde3
963002d7
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
6c7847a1
...
@@ -247,7 +247,7 @@ void _addReplyStringToList(client *c, const char *s, size_t len) {
...
@@ -247,7 +247,7 @@ void _addReplyStringToList(client *c, const char *s, size_t len) {
/* Append to this object when possible. If tail == NULL it was
/* Append to this object when possible. If tail == NULL it was
* set via addDeferredMultiBulkLength(). */
* set via addDeferredMultiBulkLength(). */
if
(
tail
&&
sdslen
(
tail
)
+
len
<=
PROTO_REPLY_CHUNK_BYTES
)
{
if
(
tail
&&
(
sdsavail
(
tail
)
>=
len
||
sdslen
(
tail
)
+
len
<=
PROTO_REPLY_CHUNK_BYTES
)
)
{
tail
=
sdscatlen
(
tail
,
s
,
len
);
tail
=
sdscatlen
(
tail
,
s
,
len
);
listNodeValue
(
ln
)
=
tail
;
listNodeValue
(
ln
)
=
tail
;
c
->
reply_bytes
+=
len
;
c
->
reply_bytes
+=
len
;
...
...
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