From 3c51d3b36b7a4295871f0033ae5a0e2e1aa339f3 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 12 Sep 2011 11:05:48 +0200 Subject: 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. --- src/networking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index 5df8f57ba..bc33a4dea 100644 --- a/src/networking.c +++ b/src/networking.c @@ -616,7 +616,7 @@ void sendReplyToClient(aeEventLoop *el, int fd, void *privdata, int mask) { } } if (totwritten > 0) c->lastinteraction = time(NULL); - if (listLength(c->reply) == 0) { + if (c->bufpos == 0 && listLength(c->reply) == 0) { c->sentlen = 0; aeDeleteFileEvent(server.el,c->fd,AE_WRITABLE); -- cgit v1.2.1