summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Sergeant <bsergean@gmail.com>2020-05-01 20:57:51 -0700
committerGitHub <noreply@github.com>2020-05-01 20:57:51 -0700
commit93021da221f71cf71fe874fd881ea59f325b82f2 (patch)
treefb315e0a85a9f931299d5983d7d28d549c3e8f22
parent365316aa59545d90de4e105cec57f22aa5b52ff9 (diff)
downloadredis-93021da221f71cf71fe874fd881ea59f325b82f2.tar.gz
Update redis-cli.c
-rw-r--r--src/redis-cli.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 880f3d70a..208f7b35d 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -3416,6 +3416,7 @@ static redisReply *clusterManagerMigrateKeysInReply(clusterManagerNode *source,
size_t *argv_len = NULL;
int c = (replace ? 8 : 7);
if (config.auth) c += 2;
+ if (config.user) c += 1;
size_t argc = c + reply->elements;
size_t i, offset = 6; // Keys Offset
argv = zcalloc(argc * sizeof(char *));
@@ -3442,12 +3443,24 @@ static redisReply *clusterManagerMigrateKeysInReply(clusterManagerNode *source,
offset++;
}
if (config.auth) {
- argv[offset] = "AUTH";
- argv_len[offset] = 4;
- offset++;
- argv[offset] = config.auth;
- argv_len[offset] = strlen(config.auth);
- offset++;
+ if (config.user) {
+ argv[offset] = "AUTH2";
+ argv_len[offset] = 5;
+ offset++;
+ argv[offset] = config.user;
+ argv_len[offset] = strlen(config.user);
+ offset++;
+ argv[offset] = config.auth;
+ argv_len[offset] = strlen(config.auth);
+ offset++;
+ } else {
+ argv[offset] = "AUTH";
+ argv_len[offset] = 4;
+ offset++;
+ argv[offset] = config.auth;
+ argv_len[offset] = strlen(config.auth);
+ offset++;
+ }
}
argv[offset] = "KEYS";
argv_len[offset] = 4;