summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_controller.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-09-27 19:22:59 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-09-27 19:22:59 +0300
commitbfa808d68997d74bfe0d54196bbbb649646787c1 (patch)
tree16751ca3da7dfd1c3c7830b3203fffdaea55b0cf /src/nxt_controller.c
parent752038eea857988045ce72252e0d1c19509981b3 (diff)
downloadunit-bfa808d68997d74bfe0d54196bbbb649646787c1.tar.gz
unit-bfa808d68997d74bfe0d54196bbbb649646787c1.tar.bz2
Event engine memory cache for nxt_sockaddr_t.
Introducing event engine memory cache and using the cache for nxt_sockaddr_t structures.
Diffstat (limited to '')
-rw-r--r--src/nxt_controller.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c
index c8bfbad6..d7a3d1a7 100644
--- a/src/nxt_controller.c
+++ b/src/nxt_controller.c
@@ -118,10 +118,18 @@ nxt_controller_start(nxt_task_t *task, void *data)
nxt_str_t *json;
nxt_runtime_t *rt;
nxt_conf_value_t *conf;
+ nxt_event_engine_t *engine;
nxt_http_fields_hash_t *hash;
rt = task->thread->runtime;
+ engine = task->thread->engine;
+
+ engine->mem_pool = nxt_mp_create(4096, 128, 1024, 64);
+ if (nxt_slow_path(engine->mem_pool == NULL)) {
+ return NXT_ERROR;
+ }
+
hash = nxt_http_fields_hash_create(nxt_controller_request_fields,
rt->mem_pool);
if (nxt_slow_path(hash == NULL)) {
@@ -686,6 +694,8 @@ nxt_controller_conn_free(nxt_task_t *task, void *obj, void *data)
nxt_debug(task, "controller conn free");
+ nxt_sockaddr_cache_free(task->thread->engine, c);
+
nxt_mp_destroy(c->mem_pool);
//nxt_free(c);