X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/8079656a8ea7c379815366c6f89f9954e86a57be..fb92ecece75ec48efb927fa6c2f2f86a58f73609:/src/t_list.c?ds=sidebyside diff --git a/src/t_list.c b/src/t_list.c index 2a981033..6b4a611e 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -823,6 +823,13 @@ void blockingPopGenericCommand(redisClient *c, int where) { } } } + /* If we are inside a MULTI/EXEC and the list is empty the only thing + * we can do is treating it as a timeout (even with timeout 0). */ + if (c->flags & REDIS_MULTI) { + addReply(c,shared.nullmultibulk); + return; + } + /* If the list is empty or the key does not exists we must block */ timeout = strtol(c->argv[c->argc-1]->ptr,NULL,10); if (timeout > 0) timeout += time(NULL);