summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conn_close.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2022-09-22 01:01:18 +0800
committerZhidao HONG <z.hong@f5.com>2022-09-22 01:01:18 +0800
commit0711101af826cf7f5cb25050587ac6788ac0451c (patch)
tree5350755ac773b3f28fdca6a6992e907ab504dfca /src/nxt_conn_close.c
parent76df62a6236eba2ae1ea7ffe7b9599418b044a01 (diff)
downloadunit-0711101af826cf7f5cb25050587ac6788ac0451c.tar.gz
unit-0711101af826cf7f5cb25050587ac6788ac0451c.tar.bz2
Status: fixed error in connection statistics.
When proxy is used, the number of accepted connections is not counted, This also results in the wrong number of active connections.
Diffstat (limited to 'src/nxt_conn_close.c')
-rw-r--r--src/nxt_conn_close.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nxt_conn_close.c b/src/nxt_conn_close.c
index 92bd8d1b..bdd66951 100644
--- a/src/nxt_conn_close.c
+++ b/src/nxt_conn_close.c
@@ -119,7 +119,9 @@ nxt_conn_close_handler(nxt_task_t *task, void *obj, void *data)
nxt_socket_close(task, c->socket.fd);
c->socket.fd = -1;
- engine->closed_conns_cnt++;
+ if (c->idle) {
+ engine->closed_conns_cnt++;
+ }
if (timers_pending == 0) {
nxt_work_queue_add(&engine->fast_work_queue,
@@ -155,7 +157,9 @@ nxt_conn_close_timer_handler(nxt_task_t *task, void *obj, void *data)
nxt_socket_close(task, c->socket.fd);
c->socket.fd = -1;
- engine->closed_conns_cnt++;
+ if (c->idle) {
+ engine->closed_conns_cnt++;
+ }
}
nxt_work_queue_add(&engine->fast_work_queue, c->write_state->ready_handler,