benchmark: add auth check in benchmark
When we run benchmark but forget to set the right requirepass, benchmark should return error.
This commit is contained in:
parent
85cdb79d14
commit
efd66faa9c
@ -204,6 +204,12 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||
if (redisBufferRead(c->context) != REDIS_OK) {
|
||||
fprintf(stderr,"Error: %s\n",c->context->errstr);
|
||||
exit(1);
|
||||
}
|
||||
else if (strlen(c->context->reader->buf)>=32
|
||||
&& !strncmp(c->context->reader->buf,"-NOAUTH Authentication required.", 32))
|
||||
{
|
||||
fprintf(stderr,"Error: %s\n",c->context->reader->buf);
|
||||
exit(1);
|
||||
} else {
|
||||
while(c->pending) {
|
||||
if (redisGetReply(c->context,&reply) != REDIS_OK) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user