diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-07-12 20:32:16 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-07-12 20:32:16 +0300 |
commit | b0c1e740cf404f8fed5eed75fddb205ca74314e0 (patch) | |
tree | 08dcefc827c5dfb1570b682ea8d1e9abf17a31dc /src/nxt_controller.c | |
parent | c38bcb7d70729434893ae4d5f2f58a78a36d2bd5 (diff) | |
download | unit-b0c1e740cf404f8fed5eed75fddb205ca74314e0.tar.gz unit-b0c1e740cf404f8fed5eed75fddb205ca74314e0.tar.bz2 |
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.
Diffstat (limited to 'src/nxt_controller.c')
-rw-r--r-- | src/nxt_controller.c | 13 |
1 files changed, 5 insertions, 8 deletions
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); |