mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Inline protocol improved to accept quoted strings.
This commit is contained in:
parent
076c2623ac
commit
75b760a72d
@ -847,7 +847,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 */
|
||||||
@ -861,7 +861,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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user