mirror of https://mirror.osredm.com/root/redis.git
redis-benchmark bad check for NOAUTH and NOPERM (#8931)
also, print errors to stderr rather than stdout
This commit is contained in:
parent
56976ffb49
commit
d32fd31588
|
@ -362,9 +362,9 @@ fail:
|
||||||
else fprintf(stderr, "%s\n", hostsocket);
|
else fprintf(stderr, "%s\n", hostsocket);
|
||||||
int abort_test = 0;
|
int abort_test = 0;
|
||||||
if (reply && reply->type == REDIS_REPLY_ERROR &&
|
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,"WRONGPASS",9) ||
|
||||||
!strncmp(reply->str,"NOPERM",5)))
|
!strncmp(reply->str,"NOPERM",6)))
|
||||||
abort_test = 1;
|
abort_test = 1;
|
||||||
freeReplyObject(reply);
|
freeReplyObject(reply);
|
||||||
redisFree(c);
|
redisFree(c);
|
||||||
|
@ -530,21 +530,21 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||||
* before requesting the new configuration. */
|
* before requesting the new configuration. */
|
||||||
fetch_slots = 1;
|
fetch_slots = 1;
|
||||||
do_wait = 1;
|
do_wait = 1;
|
||||||
printf("Error from server %s:%d: %s.\n",
|
fprintf(stderr, "Error from server %s:%d: %s.\n",
|
||||||
c->cluster_node->ip,
|
c->cluster_node->ip,
|
||||||
c->cluster_node->port,
|
c->cluster_node->port,
|
||||||
r->str);
|
r->str);
|
||||||
}
|
}
|
||||||
if (do_wait) sleep(1);
|
if (do_wait) sleep(1);
|
||||||
if (fetch_slots && !fetchClusterSlotsConfiguration(c))
|
if (fetch_slots && !fetchClusterSlotsConfiguration(c))
|
||||||
exit(1);
|
exit(1);
|
||||||
} else {
|
} else {
|
||||||
if (c->cluster_node) {
|
if (c->cluster_node) {
|
||||||
printf("Error from server %s:%d: %s\n",
|
fprintf(stderr, "Error from server %s:%d: %s\n",
|
||||||
c->cluster_node->ip,
|
c->cluster_node->ip,
|
||||||
c->cluster_node->port,
|
c->cluster_node->port,
|
||||||
r->str);
|
r->str);
|
||||||
} else printf("Error from server: %s\n", r->str);
|
} else fprintf(stderr, "Error from server: %s\n", r->str);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue