Commit 3c51d3b3 authored by antirez's avatar antirez
Browse files

Remove the write handler only if there are no longer objects in the output...

Remove the write handler only if there are no longer objects in the output queue AND if the static buffer is empty. This bug was the cause of a possible server-stop-responding-to-client bug under some specific work load. Thanks to Pieter Noordhuis for spotting and fixing it.
parent 00c7f312
...@@ -616,7 +616,7 @@ void sendReplyToClient(aeEventLoop *el, int fd, void *privdata, int mask) { ...@@ -616,7 +616,7 @@ void sendReplyToClient(aeEventLoop *el, int fd, void *privdata, int mask) {
} }
} }
if (totwritten > 0) c->lastinteraction = time(NULL); if (totwritten > 0) c->lastinteraction = time(NULL);
if (listLength(c->reply) == 0) { if (c->bufpos == 0 && listLength(c->reply) == 0) {
c->sentlen = 0; c->sentlen = 0;
aeDeleteFileEvent(server.el,c->fd,AE_WRITABLE); aeDeleteFileEvent(server.el,c->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