diff options
author | antirez <antirez@gmail.com> | 2018-09-17 16:24:07 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-09-17 16:24:07 +0200 |
commit | 9f43264f861b30546c1af90345b153241de1f118 (patch) | |
tree | 15027b78351cffb4cd22d9dc5e333b078a2975fa | |
parent | 394b974920cee6b83c7a1cf01bb43d8e0580a8ae (diff) | |
download | redis-9f43264f861b30546c1af90345b153241de1f118.tar.gz |
Revert "fix repeat argument issue and reduce unnessary loop times for redis-cli."
Reverts commit 9505dd2011ef7143670b68247ff1818ffbad9768
since the commit introduced the very serious bug issue #5286.
-rw-r--r-- | src/redis-cli.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c index a1d2d1670..deac406b0 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1173,16 +1173,6 @@ static int cliSendCommand(int argc, char **argv, long repeat) { } else if (!strcasecmp(command,"auth") && argc == 2) { cliSelect(); } - - - /* Issue the command again if we got redirected in cluster mode */ - if (config.cluster_mode && config.cluster_reissue_command) { - cliConnect(CC_FORCE); - config.cluster_reissue_command = 0; - /* for a '-MOVED' or '-ASK' response, we need to issue the command again, so - * add repeat by 1. */ - repeat++; - } } if (config.interval) usleep(config.interval); fflush(stdout); /* Make it grep friendly */ @@ -1563,8 +1553,13 @@ static int issueCommandRepeat(int argc, char **argv, long repeat) { cliPrintContextError(); return REDIS_ERR; } - } else - break; + } + /* Issue the command again if we got redirected in cluster mode */ + if (config.cluster_mode && config.cluster_reissue_command) { + cliConnect(CC_FORCE); + } else { + break; + } } return REDIS_OK; } |