mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
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
e6948b8f28
commit
4cc43a96f6
@ -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…
Reference in New Issue
Block a user