summaryrefslogtreecommitdiff
path: root/src/redis-benchmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/redis-benchmark.c')
-rw-r--r--src/redis-benchmark.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index 2759e6a3c..2785167a8 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -254,6 +254,19 @@ static redisConfig *getRedisConfig(const char *ip, int port,
else fprintf(stderr,"%s: %s\n",hostsocket,err);
goto fail;
}
+
+ if(config.auth){
+ void *authReply = NULL;
+ redisAppendCommand(c, "AUTH %s", config.auth);
+ if (REDIS_OK != redisGetReply(c, &authReply)) goto fail;
+ if (reply) freeReplyObject(reply);
+ reply = ((redisReply *) authReply);
+ if (reply->type == REDIS_REPLY_ERROR) {
+ fprintf(stderr, "ERROR: %s\n", reply->str);
+ goto fail;
+ }
+ }
+
redisAppendCommand(c, "CONFIG GET %s", "save");
redisAppendCommand(c, "CONFIG GET %s", "appendonly");
int i = 0;