summaryrefslogtreecommitdiff
path: root/src/redis-benchmark.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-05-09 18:19:25 +0300
committerGitHub <noreply@github.com>2021-05-09 18:19:25 +0300
commitd32fd315886a45426e8f6991ab8879b9a7756443 (patch)
treef43b14a794e7d324cfdc2011d7ed5231f7997ba7 /src/redis-benchmark.c
parent56976ffb4940b95cc3746b115d7f957c9e4b20f8 (diff)
downloadredis-d32fd315886a45426e8f6991ab8879b9a7756443.tar.gz
redis-benchmark bad check for NOAUTH and NOPERM (#8931)
also, print errors to stderr rather than stdout
Diffstat (limited to 'src/redis-benchmark.c')
-rw-r--r--src/redis-benchmark.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index 63fe5ce05..d124bc0dd 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -362,9 +362,9 @@ fail:
else fprintf(stderr, "%s\n", hostsocket);
int abort_test = 0;
if (reply && reply->type == REDIS_REPLY_ERROR &&
- (!strncmp(reply->str,"NOAUTH",5) ||
+ (!strncmp(reply->str,"NOAUTH",6) ||
!strncmp(reply->str,"WRONGPASS",9) ||
- !strncmp(reply->str,"NOPERM",5)))
+ !strncmp(reply->str,"NOPERM",6)))
abort_test = 1;
freeReplyObject(reply);
redisFree(c);
@@ -530,21 +530,21 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
* before requesting the new configuration. */
fetch_slots = 1;
do_wait = 1;
- printf("Error from server %s:%d: %s.\n",
- c->cluster_node->ip,
- c->cluster_node->port,
- r->str);
+ fprintf(stderr, "Error from server %s:%d: %s.\n",
+ c->cluster_node->ip,
+ c->cluster_node->port,
+ r->str);
}
if (do_wait) sleep(1);
if (fetch_slots && !fetchClusterSlotsConfiguration(c))
exit(1);
} else {
if (c->cluster_node) {
- printf("Error from server %s:%d: %s\n",
- c->cluster_node->ip,
- c->cluster_node->port,
- r->str);
- } else printf("Error from server: %s\n", r->str);
+ fprintf(stderr, "Error from server %s:%d: %s\n",
+ c->cluster_node->ip,
+ c->cluster_node->port,
+ r->str);
+ } else fprintf(stderr, "Error from server: %s\n", r->str);
exit(1);
}
}