Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ef0fa089
Commit
ef0fa089
authored
Aug 27, 2013
by
antirez
Browse files
Fix an hypothetical issue in processMultibulkBuffer().
parent
e3cbc018
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
ef0fa089
...
@@ -925,15 +925,19 @@ int processMultibulkBuffer(redisClient *c) {
...
@@ -925,15 +925,19 @@ int processMultibulkBuffer(redisClient *c) {
pos
+=
newline
-
(
c
->
querybuf
+
pos
)
+
2
;
pos
+=
newline
-
(
c
->
querybuf
+
pos
)
+
2
;
if
(
ll
>=
REDIS_MBULK_BIG_ARG
)
{
if
(
ll
>=
REDIS_MBULK_BIG_ARG
)
{
size_t
qblen
;
/* If we are going to read a large object from network
/* If we are going to read a large object from network
* try to make it likely that it will start at c->querybuf
* try to make it likely that it will start at c->querybuf
* boundary so that we can optimize object creation
* boundary so that we can optimize object creation
* avoiding a large copy of data. */
* avoiding a large copy of data. */
c
->
querybuf
=
sdsrange
(
c
->
querybuf
,
pos
,
-
1
);
c
->
querybuf
=
sdsrange
(
c
->
querybuf
,
pos
,
-
1
);
pos
=
0
;
pos
=
0
;
qblen
=
sdslen
(
c
->
querybuf
);
/* Hint the sds library about the amount of bytes this string is
/* Hint the sds library about the amount of bytes this string is
* going to contain. */
* going to contain. */
c
->
querybuf
=
sdsMakeRoomFor
(
c
->
querybuf
,
ll
+
2
-
sdslen
(
c
->
querybuf
));
if
(
qblen
<
ll
+
2
)
c
->
querybuf
=
sdsMakeRoomFor
(
c
->
querybuf
,
ll
+
2
-
qblen
);
}
}
c
->
bulklen
=
ll
;
c
->
bulklen
=
ll
;
}
}
...
...
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