summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-07-07 18:16:14 +0300
committerMax Romanov <max.romanov@nginx.com>2017-07-07 18:16:14 +0300
commite41425bb1f1e3eebdf10aa1da47d0affaf8f80d5 (patch)
tree4234d6930b61d39d238ea23eccb729515de240b4 /src/nxt_router.c
parentfc9f73bbea940b003824aec914bf6ea948c09252 (diff)
downloadunit-e41425bb1f1e3eebdf10aa1da47d0affaf8f80d5.tar.gz
unit-e41425bb1f1e3eebdf10aa1da47d0affaf8f80d5.tar.bz2
Router: connection destroy sequence fixed.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index a0c5a17d..b4f31536 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1112,6 +1112,9 @@ nxt_router_conf_release(nxt_task_t *task, nxt_socket_conf_joint_t *joint)
if (rtcf != NULL) {
nxt_debug(task, "old router conf is destroyed");
+
+ nxt_mp_thread_adopt(rtcf->mem_pool);
+
nxt_mp_destroy(rtcf->mem_pool);
}
@@ -1610,9 +1613,6 @@ nxt_router_conn_free(nxt_task_t *task, void *obj, void *data)
nxt_debug(task, "router conn close done");
- joint = c->listen->socket.data;
- nxt_router_conf_release(task, joint);
-
nxt_queue_each(rc, &c->requests, nxt_req_conn_link_t, link) {
nxt_debug(task, "conn %p close, req %uxD", c, rc->req_id);
@@ -1623,7 +1623,13 @@ nxt_router_conn_free(nxt_task_t *task, void *obj, void *data)
nxt_queue_remove(&c->link);
+ joint = c->listen->socket.data;
+
+ task = &task->thread->engine->task;
+
nxt_mp_release(c->mem_pool, c);
+
+ nxt_router_conf_release(task, joint);
}