diff options
author | filipe oliveira <filipecosta.90@gmail.com> | 2021-02-14 12:42:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 14:42:41 +0200 |
commit | efccd6353bacec9addc7278292fd8c3108d116e4 (patch) | |
tree | 978c6e85b78887aed8029d4787f8b814d4cd2999 /src/redis-benchmark.c | |
parent | 8c42d1257f8b6d7a1a8f30e37eef9b55785b2426 (diff) | |
download | redis-efccd6353bacec9addc7278292fd8c3108d116e4.tar.gz |
redis-benchmark: Fix broken protocol when used with -a or --dbnum (#8486)
Fix the pointers to the slot hash tags in the case of prefixed commands usage
i.e. AUTH / SELECT
It adjusts the pointers to the slot hash tags in the case of prefixed commands
usage as soon as we get the 1st reply (same like we already did for the random
strings within the command )
Diffstat (limited to 'src/redis-benchmark.c')
-rw-r--r-- | src/redis-benchmark.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c index 164f5e3ee..186739766 100644 --- a/src/redis-benchmark.c +++ b/src/redis-benchmark.c @@ -567,6 +567,9 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { * we need to randomize. */ for (j = 0; j < c->randlen; j++) c->randptr[j] -= c->prefixlen; + /* Fix the pointers to the slot hash tags */ + for (j = 0; j < c->staglen; j++) + c->stagptr[j] -= c->prefixlen; c->prefixlen = 0; } continue; |