From b0c1e740cf404f8fed5eed75fddb205ca74314e0 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 12 Jul 2017 20:32:16 +0300 Subject: New process port exchange changed. READY message type introduced. Application process start request DATA message from router to master. Master notifies router via NEW_PORT message after worker process become ready. --- src/nxt_controller.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/nxt_controller.c') diff --git a/src/nxt_controller.c b/src/nxt_controller.c index 4cf6ff95..ec0f99bc 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -89,15 +89,18 @@ static const nxt_event_conn_state_t nxt_controller_conn_close_state; nxt_int_t -nxt_controller_start(nxt_task_t *task, nxt_runtime_t *rt) +nxt_controller_start(nxt_task_t *task, void *data) { nxt_mp_t *mp; + nxt_runtime_t *rt; nxt_conf_value_t *conf; nxt_http_fields_hash_t *hash; static const nxt_str_t json = nxt_string("{ \"listeners\": {}, \"applications\": {} }"); + rt = task->thread->runtime; + hash = nxt_http_fields_hash_create(nxt_controller_request_fields, rt->mem_pool); if (nxt_slow_path(hash == NULL)) { @@ -853,13 +856,7 @@ nxt_controller_conf_pass(nxt_task_t *task, nxt_conf_value_t *conf) rt = task->thread->runtime; - nxt_runtime_port_each(rt, port) { - - if (port->type == NXT_PROCESS_ROUTER) { - break; - } - - } nxt_runtime_port_loop; + port = rt->port_by_type[NXT_PROCESS_ROUTER]; size = nxt_conf_json_length(conf, NULL); -- cgit