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
a1d37ba4
Commit
a1d37ba4
authored
Jul 24, 2013
by
antirez
Browse files
Inline protocol improved to accept quoted strings.
parent
57c8e026
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
a1d37ba4
...
@@ -829,7 +829,7 @@ void resetClient(redisClient *c) {
...
@@ -829,7 +829,7 @@ void resetClient(redisClient *c) {
int
processInlineBuffer
(
redisClient
*
c
)
{
int
processInlineBuffer
(
redisClient
*
c
)
{
char
*
newline
=
strstr
(
c
->
querybuf
,
"
\r\n
"
);
char
*
newline
=
strstr
(
c
->
querybuf
,
"
\r\n
"
);
int
argc
,
j
;
int
argc
,
j
;
sds
*
argv
;
sds
*
argv
,
aux
;
size_t
querylen
;
size_t
querylen
;
/* Nothing to do without a \r\n */
/* Nothing to do without a \r\n */
...
@@ -843,7 +843,9 @@ int processInlineBuffer(redisClient *c) {
...
@@ -843,7 +843,9 @@ int processInlineBuffer(redisClient *c) {
/* 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
);
argv
=
sdssplitlen
(
c
->
querybuf
,
querylen
,
" "
,
1
,
&
argc
);
aux
=
sdsnewlen
(
c
->
querybuf
,
querylen
);
argv
=
sdssplitargs
(
aux
,
&
argc
);
sdsfree
(
aux
);
/* Leave data after the first line of the query in the buffer */
/* Leave data after the first line of the query in the buffer */
c
->
querybuf
=
sdsrange
(
c
->
querybuf
,
querylen
+
2
,
-
1
);
c
->
querybuf
=
sdsrange
(
c
->
querybuf
,
querylen
+
2
,
-
1
);
...
...
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