summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-07-24 10:37:55 +0200
committerantirez <antirez@gmail.com>2013-07-24 10:37:55 +0200
commit75b760a72d916a91d86f5cf9531d95e0f524ec40 (patch)
treee6bc304df334024529b960ddf7a4ffeb53d0c2d2
parent076c2623aceadfc9247515841fa0970ce56e3081 (diff)
downloadredis-75b760a72d916a91d86f5cf9531d95e0f524ec40.tar.gz
Inline protocol improved to accept quoted strings.
-rw-r--r--src/networking.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/networking.c b/src/networking.c
index 54dfc025e..f7cfeb098 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -847,7 +847,7 @@ void resetClient(redisClient *c) {
int processInlineBuffer(redisClient *c) {
char *newline = strstr(c->querybuf,"\r\n");
int argc, j;
- sds *argv;
+ sds *argv, aux;
size_t querylen;
/* Nothing to do without a \r\n */
@@ -861,7 +861,9 @@ int processInlineBuffer(redisClient *c) {
/* Split the input buffer up to the \r\n */
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 */
c->querybuf = sdsrange(c->querybuf,querylen+2,-1);