Cluster: ASKING command fixed, state was not retained.

This commit is contained in:
antirez 2013-02-20 17:07:52 +01:00
parent b8d8b9ec41
commit 9ec1b709f5

View File

@ -816,12 +816,16 @@ void sendReplyToClient(aeEventLoop *el, int fd, void *privdata, int mask) {
/* resetClient prepare the client to process the next command */
void resetClient(redisClient *c) {
redisCommandProc *prevcmd = c->cmd ? c->cmd->proc : NULL;
freeClientArgv(c);
c->reqtype = 0;
c->multibulklen = 0;
c->bulklen = -1;
/* We clear the ASKING flag as well if we are not inside a MULTI. */
if (!(c->flags & REDIS_MULTI)) c->flags &= (~REDIS_ASKING);
/* We clear the ASKING flag as well if we are not inside a MULTI, and
* if what we just executed is not the ASKING command itself. */
if (!(c->flags & REDIS_MULTI) && prevcmd != askingCommand)
c->flags &= (~REDIS_ASKING);
}
int processInlineBuffer(redisClient *c) {