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
eaf1bfb8
Commit
eaf1bfb8
authored
Dec 09, 2013
by
antirez
Browse files
Handle inline requested terminated with just \n.
parent
c590549e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
eaf1bfb8
...
@@ -865,11 +865,14 @@ void resetClient(redisClient *c) {
...
@@ -865,11 +865,14 @@ void resetClient(redisClient *c) {
}
}
int
processInlineBuffer
(
redisClient
*
c
)
{
int
processInlineBuffer
(
redisClient
*
c
)
{
char
*
newline
=
strstr
(
c
->
querybuf
,
"
\r\n
"
)
;
char
*
newline
;
int
argc
,
j
;
int
argc
,
j
;
sds
*
argv
,
aux
;
sds
*
argv
,
aux
;
size_t
querylen
;
size_t
querylen
;
/* Search for end of line */
newline
=
strchr
(
c
->
querybuf
,
'\n'
);
/* Nothing to do without a \r\n */
/* Nothing to do without a \r\n */
if
(
newline
==
NULL
)
{
if
(
newline
==
NULL
)
{
if
(
sdslen
(
c
->
querybuf
)
>
REDIS_INLINE_MAX_SIZE
)
{
if
(
sdslen
(
c
->
querybuf
)
>
REDIS_INLINE_MAX_SIZE
)
{
...
@@ -879,6 +882,10 @@ int processInlineBuffer(redisClient *c) {
...
@@ -879,6 +882,10 @@ int processInlineBuffer(redisClient *c) {
return
REDIS_ERR
;
return
REDIS_ERR
;
}
}
/* Handle the \r\n case. */
if
(
newline
&&
newline
!=
c
->
querybuf
&&
*
(
newline
-
1
)
==
'\r'
)
newline
--
;
/* Split the input buffer up to the \r\n */
/* Split the input buffer up to the \r\n */
querylen
=
newline
-
(
c
->
querybuf
);
querylen
=
newline
-
(
c
->
querybuf
);
aux
=
sdsnewlen
(
c
->
querybuf
,
querylen
);
aux
=
sdsnewlen
(
c
->
querybuf
,
querylen
);
...
...
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