Unverified Commit bb875603 authored by ivanstosic-janea's avatar ivanstosic-janea Committed by GitHub
Browse files

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
parent 9a0ab2fb
...@@ -632,6 +632,9 @@ static void writeHandler(aeEventLoop *el, int fd, void *privdata, int mask) { ...@@ -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)); fprintf(stderr, "Error writing to the server: %s\n", strerror(errno));
freeClient(c); freeClient(c);
return; return;
} else if (nwritten > 0) {
c->written += nwritten;
return;
} }
} else { } else {
aeDeleteFileEvent(el,c->context->fd,AE_WRITABLE); aeDeleteFileEvent(el,c->context->fd,AE_WRITABLE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment