From: antirez Date: Tue, 31 Aug 2010 09:23:12 +0000 (+0200) Subject: resolved conflict merging pietern/bpop-timeout X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/f7f12a606c39fcb09a203faaaa12c49882409d8f resolved conflict merging pietern/bpop-timeout --- f7f12a606c39fcb09a203faaaa12c49882409d8f diff --cc src/t_list.c index 6b4a611e,43d292b6..add1bee1 --- a/src/t_list.c +++ b/src/t_list.c @@@ -823,15 -834,9 +834,16 @@@ void blockingPopGenericCommand(redisCli } } } + + /* 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); + timeout = lltimeout; if (timeout > 0) timeout += time(NULL); blockForKeys(c,c->argv+1,c->argc-2,timeout); }