Permalink
Browse files

Remove the write handler only if there are no longer objects in the o…

…utput 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.
  • Loading branch information...
1 parent 00c7f31 commit 3c51d3b36b7a4295871f0033ae5a0e2e1aa339f3 @antirez committed Sep 12, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/networking.c
View
@@ -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);

0 comments on commit 3c51d3b

Please sign in to comment.