Fix protocol error caused by redis-benchmark (#10236)

The protocol error was caused by the buggy `writeHandler` in `redis-benchmark.c`,
which didn't handle one of the cases, thereby repeating data, leading to protocol errors
when the values being sent are very long.

This PR fixes #10233, issue introduced by #7959
This commit is contained in:
ivanstosic-janea 2022-02-07 21:57:11 +01:00 committed by GitHub
parent 9a0ab2fbbf
commit bb875603fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -632,6 +632,9 @@ static void writeHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
fprintf(stderr, "Error writing to the server: %s\n", strerror(errno));
freeClient(c);
return;
} else if (nwritten > 0) {
c->written += nwritten;
return;
}
} else {
aeDeleteFileEvent(el,c->context->fd,AE_WRITABLE);