Skip to content

Commit

Permalink
Remove the write handler only if there are no longer objects in the o…
Browse files Browse the repository at this point in the history
…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
antirez committed Sep 12, 2011
1 parent 24a1580 commit 61f57b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/networking.c
Expand Up @@ -611,7 +611,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);

Expand Down

0 comments on commit 61f57b6

Please sign in to comment.