]> git.saurik.com Git - redis.git/commitdiff
Fix crash when pipelining several blocking commands.
authorHampus Wessman <hampus.wessman@gmail.com>
Thu, 28 Jul 2011 09:20:42 +0000 (11:20 +0200)
committerSalvatore Sanfilippo <antirez@Salvatores-MacBook-Air.local>
Thu, 28 Jul 2011 11:50:44 +0000 (13:50 +0200)
src/networking.c

index 629267d1cad2d025fe958407569c1a88043a810c..7f9b96f7da01c7ebdfcbd1202f510fffa4eec1f6 100644 (file)
@@ -793,6 +793,9 @@ int processMultibulkBuffer(redisClient *c) {
 void processInputBuffer(redisClient *c) {
     /* Keep processing while there is something in the input buffer */
     while(sdslen(c->querybuf)) {
+        /* Immediately abort if the client is in the middle of something. */
+        if (c->flags & REDIS_BLOCKED) return;
+
         /* REDIS_CLOSE_AFTER_REPLY closes the connection once the reply is
          * written to the client. Make sure to not let the reply grow after
          * this flag has been set (i.e. don't process more commands). */