diff --git a/src/networking.c b/src/networking.c index ec591245e..27006514d 100644 --- a/src/networking.c +++ b/src/networking.c @@ -927,6 +927,10 @@ int writeToClient(int fd, client *c, int handler_installed) { listDelNode(c->reply,listFirst(c->reply)); c->sentlen = 0; c->reply_bytes -= objlen; + /* If there are no longer objects in the list, we expect + * the count of reply bytes to be exactly zero. */ + if (listLength(c->reply) == 0) + serverAssert(c->reply_bytes == 0); } } /* Note that we avoid to send more than NET_MAX_WRITES_PER_EVENT