mirror of
https://github.com/redis/redis.git
synced 2026-06-08 16:24:26 -04:00
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:
parent
9a0ab2fbbf
commit
bb875603fb
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue