Merge pull request #3802 from flowly/bugfix-calc-stat-net-output-bytes

Bugfix calc stat net output bytes
This commit is contained in:
Salvatore Sanfilippo 2017-06-20 17:01:16 +02:00 committed by GitHub
commit ef446bf16d

View File

@ -937,11 +937,11 @@ int writeToClient(int fd, client *c, int handler_installed) {
*
* However if we are over the maxmemory limit we ignore that and
* just deliver as much data as it is possible to deliver. */
server.stat_net_output_bytes += totwritten;
if (totwritten > NET_MAX_WRITES_PER_EVENT &&
(server.maxmemory == 0 ||
zmalloc_used_memory() < server.maxmemory)) break;
}
server.stat_net_output_bytes += totwritten;
if (nwritten == -1) {
if (errno == EAGAIN) {
nwritten = 0;