From a4f3f93b90c7cc688ffff665914bdadc224847fc Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 17 Sep 2010 16:05:01 +0200 Subject: [PATCH] new parsing code bugfixing --- src/networking.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/networking.c b/src/networking.c index aaf7518f1..632fd0476 100644 --- a/src/networking.c +++ b/src/networking.c @@ -664,6 +664,8 @@ void closeTimedoutClients(void) { } void processInputBuffer(redisClient *c) { + int seeknewline = 0; + again: /* Before to process the input buffer, make sure the client is not * waitig for a blocking operation such as BLPOP. Note that the first @@ -672,6 +674,9 @@ again: * in the input buffer the client may be blocked, and the "goto again" * will try to reiterate. The following line will make it return asap. */ if (c->flags & REDIS_BLOCKED || c->flags & REDIS_IO_WAIT) return; + + if (seeknewline && c->bulklen == -1) c->newline = strchr(c->querybuf,'\n'); + seeknewline = 1; if (c->bulklen == -1) { /* Read the first line of the query */ size_t querylen;