diff options
author | Andrei Belov <defan@nginx.com> | 2020-04-16 18:27:26 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2020-04-16 18:27:26 +0300 |
commit | 74f32d26b91f49d3392605e81c1597b375890b60 (patch) | |
tree | adfc67dfc86461441bde65512f745ce27bd6ea28 /src/nxt_controller.c | |
parent | 2ff9df10ef1df43c935c870175e52473dad2c21a (diff) | |
parent | 9877087756144d3bdf343d0d4e91e1efbcc62c93 (diff) | |
download | unit-74f32d26b91f49d3392605e81c1597b375890b60.tar.gz unit-74f32d26b91f49d3392605e81c1597b375890b60.tar.bz2 |
Merged with the default branch.1.17.0-1
Diffstat (limited to 'src/nxt_controller.c')
-rw-r--r-- | src/nxt_controller.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c index cc1ed534..f9b2cf26 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -130,14 +130,11 @@ nxt_controller_start(nxt_task_t *task, void *data) nxt_mp_t *mp; nxt_int_t ret; nxt_str_t *json; - nxt_runtime_t *rt; nxt_conf_value_t *conf; nxt_conf_validation_t vldt; nxt_controller_init_t *init; - rt = task->thread->runtime; - - ret = nxt_http_fields_hash(&nxt_controller_fields_hash, rt->mem_pool, + ret = nxt_http_fields_hash(&nxt_controller_fields_hash, nxt_controller_request_fields, nxt_nitems(nxt_controller_request_fields)); @@ -402,24 +399,14 @@ nxt_controller_conf_send(nxt_task_t *task, nxt_conf_value_t *conf, nxt_int_t nxt_runtime_controller_socket(nxt_task_t *task, nxt_runtime_t *rt) { - nxt_sockaddr_t *sa; nxt_listen_socket_t *ls; - sa = rt->controller_listen; - ls = nxt_mp_alloc(rt->mem_pool, sizeof(nxt_listen_socket_t)); if (ls == NULL) { return NXT_ERROR; } - ls->sockaddr = nxt_sockaddr_create(rt->mem_pool, &sa->u.sockaddr, - sa->socklen, sa->length); - if (ls->sockaddr == NULL) { - return NXT_ERROR; - } - - ls->sockaddr->type = sa->type; - nxt_sockaddr_text(ls->sockaddr); + ls->sockaddr = rt->controller_listen; nxt_listen_socket_remote_size(ls); @@ -441,7 +428,7 @@ nxt_runtime_controller_socket(nxt_task_t *task, nxt_runtime_t *rt) #endif ls->handler = nxt_controller_conn_init; - if (nxt_listen_socket_create(task, ls, 0) != NXT_OK) { + if (nxt_listen_socket_create(task, rt->mem_pool, ls) != NXT_OK) { return NXT_ERROR; } |