Commit de07deb4 authored by minghang.zmh's avatar minghang.zmh
Browse files

fix server.stat_net_output_bytes calc bug

parent 1f72ec7d
...@@ -931,11 +931,11 @@ int writeToClient(int fd, client *c, int handler_installed) { ...@@ -931,11 +931,11 @@ int writeToClient(int fd, client *c, int handler_installed) {
* *
* However if we are over the maxmemory limit we ignore that and * However if we are over the maxmemory limit we ignore that and
* just deliver as much data as it is possible to deliver. */ * just deliver as much data as it is possible to deliver. */
server.stat_net_output_bytes += totwritten;
if (totwritten > NET_MAX_WRITES_PER_EVENT && if (totwritten > NET_MAX_WRITES_PER_EVENT &&
(server.maxmemory == 0 || (server.maxmemory == 0 ||
zmalloc_used_memory() < server.maxmemory)) break; zmalloc_used_memory() < server.maxmemory)) break;
} }
server.stat_net_output_bytes += totwritten;
if (nwritten == -1) { if (nwritten == -1) {
if (errno == EAGAIN) { if (errno == EAGAIN) {
nwritten = 0; nwritten = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment