diff options
-rw-r--r-- | auto/sources | 4 | ||||
-rw-r--r-- | src/nginext/nxt_go_lib.c | 2 | ||||
-rw-r--r-- | src/nginext/port.go | 8 | ||||
-rw-r--r-- | src/nxt_application.c | 4 | ||||
-rw-r--r-- | src/nxt_controller.c | 2 | ||||
-rw-r--r-- | src/nxt_go.c | 2 | ||||
-rw-r--r-- | src/nxt_main_process.c (renamed from src/nxt_master_process.c) | 136 | ||||
-rw-r--r-- | src/nxt_main_process.h (renamed from src/nxt_master_process.h) | 12 | ||||
-rw-r--r-- | src/nxt_port.c | 4 | ||||
-rw-r--r-- | src/nxt_process.c | 18 | ||||
-rw-r--r-- | src/nxt_process.h | 2 | ||||
-rw-r--r-- | src/nxt_router.c | 26 | ||||
-rw-r--r-- | src/nxt_router.h | 2 | ||||
-rw-r--r-- | src/nxt_runtime.c | 16 | ||||
-rw-r--r-- | src/nxt_runtime.h | 6 | ||||
-rw-r--r-- | src/nxt_worker_process.c | 2 |
16 files changed, 123 insertions, 123 deletions
diff --git a/auto/sources b/auto/sources index 1eba9e68..5c80f756 100644 --- a/auto/sources +++ b/auto/sources @@ -72,7 +72,7 @@ NXT_LIB_DEPS=" \ src/nxt_runtime.h \ src/nxt_conf.h \ src/nxt_application.h \ - src/nxt_master_process.h \ + src/nxt_main_process.h \ src/nxt_router.h \ src/nxt_port_hash.h \ " @@ -151,7 +151,7 @@ NXT_LIB_SRCS=" \ src/nxt_conf.c \ src/nxt_conf_validation.c \ src/nxt_stream_module.c \ - src/nxt_master_process.c \ + src/nxt_main_process.c \ src/nxt_worker_process.c \ src/nxt_controller.c \ src/nxt_router.c \ diff --git a/src/nginext/nxt_go_lib.c b/src/nginext/nxt_go_lib.c index 6d5d2a03..474d313b 100644 --- a/src/nginext/nxt_go_lib.c +++ b/src/nginext/nxt_go_lib.c @@ -179,7 +179,7 @@ nxt_go_ready() port_msg.last = 1; port_msg.mmap = 0; - nxt_go_master_send(&port_msg, sizeof(port_msg), NULL, 0); + nxt_go_main_send(&port_msg, sizeof(port_msg), NULL, 0); } diff --git a/src/nginext/port.go b/src/nginext/port.go index 639b73d5..26ca26d2 100644 --- a/src/nginext/port.go +++ b/src/nginext/port.go @@ -63,7 +63,7 @@ func remove_by_pid(pid int) { port_registry_.Unlock() } -func master_port() *port { +func main_port() *port { port_registry_.RLock() res := port_registry_.t[1] port_registry_.RUnlock() @@ -143,9 +143,9 @@ func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int, o return 0 } -//export nxt_go_master_send -func nxt_go_master_send(buf unsafe.Pointer, buf_size C.int, oob unsafe.Pointer, oob_size C.int) C.int { - p := master_port() +//export nxt_go_main_send +func nxt_go_main_send(buf unsafe.Pointer, buf_size C.int, oob unsafe.Pointer, oob_size C.int) C.int { + p := main_port() if p != nil { n, oobn, err := p.snd.WriteMsgUnix(C.GoBytes(buf, buf_size), C.GoBytes(oob, oob_size), nil) diff --git a/src/nxt_application.c b/src/nxt_application.c index 23182401..dc23c0d7 100644 --- a/src/nxt_application.c +++ b/src/nxt_application.c @@ -9,7 +9,7 @@ #include <nxt_main.h> #include <nxt_runtime.h> #include <nxt_application.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> #include <glob.h> @@ -50,7 +50,7 @@ nxt_discovery_start(nxt_task_t *task, void *data) b = nxt_discovery_modules(task, rt->modules); - main_port = rt->port_by_type[NXT_PROCESS_MASTER]; + main_port = rt->port_by_type[NXT_PROCESS_MAIN]; nxt_port_socket_write(task, main_port, NXT_PORT_MSG_MODULES, -1, 0, -1, b); diff --git a/src/nxt_controller.c b/src/nxt_controller.c index d03025b8..00742607 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -7,7 +7,7 @@ #include <nxt_main.h> #include <nxt_runtime.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> #include <nxt_conf.h> diff --git a/src/nxt_go.c b/src/nxt_go.c index ee446921..1c1961b2 100644 --- a/src/nxt_go.c +++ b/src/nxt_go.c @@ -51,7 +51,7 @@ nxt_go_init(nxt_task_t *task, nxt_common_app_conf_t *conf) nxt_runtime_port_each(rt, port) { - if (port->pid != nxt_pid && port->type != NXT_PROCESS_MASTER) { + if (port->pid != nxt_pid && port->type != NXT_PROCESS_MAIN) { continue; } diff --git a/src/nxt_master_process.c b/src/nxt_main_process.c index 8a4f8564..110867ca 100644 --- a/src/nxt_master_process.c +++ b/src/nxt_main_process.c @@ -7,7 +7,7 @@ #include <nxt_main.h> #include <nxt_runtime.h> #include <nxt_port.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> #include <nxt_conf.h> #include <nxt_application.h> @@ -20,43 +20,43 @@ typedef struct { } nxt_listening_socket_t; -static nxt_int_t nxt_master_process_port_create(nxt_task_t *task, +static nxt_int_t nxt_main_process_port_create(nxt_task_t *task, nxt_runtime_t *rt); -static void nxt_master_process_title(nxt_task_t *task); -static nxt_int_t nxt_master_start_controller_process(nxt_task_t *task, +static void nxt_main_process_title(nxt_task_t *task); +static nxt_int_t nxt_main_start_controller_process(nxt_task_t *task, nxt_runtime_t *rt); -static nxt_int_t nxt_master_start_router_process(nxt_task_t *task, +static nxt_int_t nxt_main_start_router_process(nxt_task_t *task, nxt_runtime_t *rt); -static nxt_int_t nxt_master_start_discovery_process(nxt_task_t *task, +static nxt_int_t nxt_main_start_discovery_process(nxt_task_t *task, nxt_runtime_t *rt); -static nxt_int_t nxt_master_start_worker_process(nxt_task_t *task, +static nxt_int_t nxt_main_start_worker_process(nxt_task_t *task, nxt_runtime_t *rt, nxt_common_app_conf_t *app_conf, uint32_t stream); -static nxt_int_t nxt_master_create_worker_process(nxt_task_t *task, +static nxt_int_t nxt_main_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt, nxt_process_init_t *init); -static void nxt_master_process_sigterm_handler(nxt_task_t *task, void *obj, +static void nxt_main_process_sigterm_handler(nxt_task_t *task, void *obj, void *data); -static void nxt_master_process_sigquit_handler(nxt_task_t *task, void *obj, +static void nxt_main_process_sigquit_handler(nxt_task_t *task, void *obj, void *data); -static void nxt_master_process_sigusr1_handler(nxt_task_t *task, void *obj, +static void nxt_main_process_sigusr1_handler(nxt_task_t *task, void *obj, void *data); -static void nxt_master_process_sigchld_handler(nxt_task_t *task, void *obj, +static void nxt_main_process_sigchld_handler(nxt_task_t *task, void *obj, void *data); -static void nxt_master_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid); -static void nxt_master_port_socket_handler(nxt_task_t *task, +static void nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid); +static void nxt_main_port_socket_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); -static nxt_int_t nxt_master_listening_socket(nxt_sockaddr_t *sa, +static nxt_int_t nxt_main_listening_socket(nxt_sockaddr_t *sa, nxt_listening_socket_t *ls); -static void nxt_master_port_modules_handler(nxt_task_t *task, +static void nxt_main_port_modules_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); static int nxt_cdecl nxt_app_lang_compare(const void *v1, const void *v2); -const nxt_sig_event_t nxt_master_process_signals[] = { - nxt_event_signal(SIGINT, nxt_master_process_sigterm_handler), - nxt_event_signal(SIGQUIT, nxt_master_process_sigquit_handler), - nxt_event_signal(SIGTERM, nxt_master_process_sigterm_handler), - nxt_event_signal(SIGCHLD, nxt_master_process_sigchld_handler), - nxt_event_signal(SIGUSR1, nxt_master_process_sigusr1_handler), +const nxt_sig_event_t nxt_main_process_signals[] = { + nxt_event_signal(SIGINT, nxt_main_process_sigterm_handler), + nxt_event_signal(SIGQUIT, nxt_main_process_sigquit_handler), + nxt_event_signal(SIGTERM, nxt_main_process_sigterm_handler), + nxt_event_signal(SIGCHLD, nxt_main_process_sigchld_handler), + nxt_event_signal(SIGUSR1, nxt_main_process_sigusr1_handler), nxt_event_signal_end, }; @@ -65,23 +65,23 @@ static nxt_bool_t nxt_exiting; nxt_int_t -nxt_master_process_start(nxt_thread_t *thr, nxt_task_t *task, +nxt_main_process_start(nxt_thread_t *thr, nxt_task_t *task, nxt_runtime_t *rt) { - rt->types |= (1U << NXT_PROCESS_MASTER); + rt->types |= (1U << NXT_PROCESS_MAIN); - if (nxt_master_process_port_create(task, rt) != NXT_OK) { + if (nxt_main_process_port_create(task, rt) != NXT_OK) { return NXT_ERROR; } - nxt_master_process_title(task); + nxt_main_process_title(task); /* * The dicsovery process will send a message processed by - * nxt_master_port_modules_handler() which starts the controller + * nxt_main_port_modules_handler() which starts the controller * and router processes. */ - return nxt_master_start_discovery_process(task, rt); + return nxt_main_start_discovery_process(task, rt); } @@ -149,15 +149,15 @@ static nxt_conf_map_t nxt_common_app_conf[] = { static void -nxt_port_master_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) +nxt_port_main_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) { - nxt_debug(task, "master data: %*s", + nxt_debug(task, "main data: %*s", nxt_buf_mem_used_size(&msg->buf->mem), msg->buf->mem.pos); } static void -nxt_port_master_start_worker_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) +nxt_port_main_start_worker_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) { u_char *start; nxt_mp_t *mp; @@ -170,7 +170,7 @@ nxt_port_master_start_worker_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) b = msg->buf; - nxt_debug(task, "master start worker: %*s", b->mem.free - b->mem.pos, + nxt_debug(task, "main start worker: %*s", b->mem.free - b->mem.pos, b->mem.pos); mp = nxt_mp_create(1024, 128, 256, 32); @@ -200,31 +200,31 @@ nxt_port_master_start_worker_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) return; } - ret = nxt_master_start_worker_process(task, task->thread->runtime, - &app_conf, msg->port_msg.stream); + ret = nxt_main_start_worker_process(task, task->thread->runtime, + &app_conf, msg->port_msg.stream); nxt_mp_destroy(mp); } -static nxt_port_handler_t nxt_master_process_port_handlers[] = { +static nxt_port_handler_t nxt_main_process_port_handlers[] = { NULL, /* NXT_PORT_MSG_QUIT */ NULL, /* NXT_PORT_MSG_NEW_PORT */ NULL, /* NXT_PORT_MSG_CHANGE_FILE */ NULL, /* NXT_PORT_MSG_MMAP */ - nxt_port_master_data_handler, + nxt_port_main_data_handler, NULL, /* NXT_PORT_MSG_REMOVE_PID */ nxt_port_ready_handler, - nxt_port_master_start_worker_handler, - nxt_master_port_socket_handler, - nxt_master_port_modules_handler, + nxt_port_main_start_worker_handler, + nxt_main_port_socket_handler, + nxt_main_port_modules_handler, nxt_port_rpc_handler, nxt_port_rpc_handler, }; static nxt_int_t -nxt_master_process_port_create(nxt_task_t *task, nxt_runtime_t *rt) +nxt_main_process_port_create(nxt_task_t *task, nxt_runtime_t *rt) { nxt_int_t ret; nxt_port_t *port; @@ -235,7 +235,7 @@ nxt_master_process_port_create(nxt_task_t *task, nxt_runtime_t *rt) return NXT_ERROR; } - port = nxt_port_new(task, 0, nxt_pid, NXT_PROCESS_MASTER); + port = nxt_port_new(task, 0, nxt_pid, NXT_PROCESS_MAIN); if (nxt_slow_path(port == NULL)) { return NXT_ERROR; } @@ -250,10 +250,10 @@ nxt_master_process_port_create(nxt_task_t *task, nxt_runtime_t *rt) nxt_runtime_port_add(rt, port); /* - * A master process port. A write port is not closed + * A main process port. A write port is not closed * since it should be inherited by worker processes. */ - nxt_port_enable(task, port, nxt_master_process_port_handlers); + nxt_port_enable(task, port, nxt_main_process_port_handlers); process->ready = 1; @@ -262,7 +262,7 @@ nxt_master_process_port_create(nxt_task_t *task, nxt_runtime_t *rt) static void -nxt_master_process_title(nxt_task_t *task) +nxt_main_process_title(nxt_task_t *task) { u_char *p, *end; nxt_uint_t i; @@ -287,7 +287,7 @@ nxt_master_process_title(nxt_task_t *task) static nxt_int_t -nxt_master_start_controller_process(nxt_task_t *task, nxt_runtime_t *rt) +nxt_main_start_controller_process(nxt_task_t *task, nxt_runtime_t *rt) { nxt_process_init_t *init; @@ -306,12 +306,12 @@ nxt_master_start_controller_process(nxt_task_t *task, nxt_runtime_t *rt) init->stream = 0; init->restart = 1; - return nxt_master_create_worker_process(task, rt, init); + return nxt_main_create_worker_process(task, rt, init); } static nxt_int_t -nxt_master_start_discovery_process(nxt_task_t *task, nxt_runtime_t *rt) +nxt_main_start_discovery_process(nxt_task_t *task, nxt_runtime_t *rt) { nxt_process_init_t *init; @@ -330,12 +330,12 @@ nxt_master_start_discovery_process(nxt_task_t *task, nxt_runtime_t *rt) init->stream = 0; init->restart = 0; - return nxt_master_create_worker_process(task, rt, init); + return nxt_main_create_worker_process(task, rt, init); } static nxt_int_t -nxt_master_start_router_process(nxt_task_t *task, nxt_runtime_t *rt) +nxt_main_start_router_process(nxt_task_t *task, nxt_runtime_t *rt) { nxt_process_init_t *init; @@ -354,12 +354,12 @@ nxt_master_start_router_process(nxt_task_t *task, nxt_runtime_t *rt) init->stream = 0; init->restart = 1; - return nxt_master_create_worker_process(task, rt, init); + return nxt_main_create_worker_process(task, rt, init); } static nxt_int_t -nxt_master_start_worker_process(nxt_task_t *task, nxt_runtime_t *rt, +nxt_main_start_worker_process(nxt_task_t *task, nxt_runtime_t *rt, nxt_common_app_conf_t *app_conf, uint32_t stream) { char *user, *group; @@ -416,12 +416,12 @@ nxt_master_start_worker_process(nxt_task_t *task, nxt_runtime_t *rt, init->stream = stream; init->restart = 0; - return nxt_master_create_worker_process(task, rt, init); + return nxt_main_create_worker_process(task, rt, init); } static nxt_int_t -nxt_master_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt, +nxt_main_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt, nxt_process_init_t *init) { nxt_int_t ret; @@ -466,7 +466,7 @@ nxt_master_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt, return NXT_AGAIN; default: - /* The master process created a new process. */ + /* The main process created a new process. */ nxt_port_read_close(port); nxt_port_write_enable(task, port); @@ -477,7 +477,7 @@ nxt_master_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt, void -nxt_master_stop_worker_processes(nxt_task_t *task, nxt_runtime_t *rt) +nxt_main_stop_worker_processes(nxt_task_t *task, nxt_runtime_t *rt) { nxt_port_t *port; nxt_process_t *process; @@ -501,7 +501,7 @@ nxt_master_stop_worker_processes(nxt_task_t *task, nxt_runtime_t *rt) static void -nxt_master_process_sigterm_handler(nxt_task_t *task, void *obj, void *data) +nxt_main_process_sigterm_handler(nxt_task_t *task, void *obj, void *data) { nxt_debug(task, "sigterm handler signo:%d (%s)", (int) (uintptr_t) obj, data); @@ -515,7 +515,7 @@ nxt_master_process_sigterm_handler(nxt_task_t *task, void *obj, void *data) static void -nxt_master_process_sigquit_handler(nxt_task_t *task, void *obj, void *data) +nxt_main_process_sigquit_handler(nxt_task_t *task, void *obj, void *data) { nxt_debug(task, "sigquit handler signo:%d (%s)", (int) (uintptr_t) obj, data); @@ -529,7 +529,7 @@ nxt_master_process_sigquit_handler(nxt_task_t *task, void *obj, void *data) static void -nxt_master_process_sigusr1_handler(nxt_task_t *task, void *obj, void *data) +nxt_main_process_sigusr1_handler(nxt_task_t *task, void *obj, void *data) { nxt_mp_t *mp; nxt_int_t ret; @@ -619,7 +619,7 @@ fail: static void -nxt_master_process_sigchld_handler(nxt_task_t *task, void *obj, void *data) +nxt_main_process_sigchld_handler(nxt_task_t *task, void *obj, void *data) { int status; nxt_err_t err; @@ -668,13 +668,13 @@ nxt_master_process_sigchld_handler(nxt_task_t *task, void *obj, void *data) pid, WEXITSTATUS(status)); } - nxt_master_cleanup_worker_process(task, pid); + nxt_main_cleanup_worker_process(task, pid); } } static void -nxt_master_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid) +nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid) { nxt_buf_t *buf; nxt_port_t *port; @@ -719,7 +719,7 @@ nxt_master_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid) } else if (init != NULL) { if (init->restart != 0) { - (void) nxt_master_create_worker_process(task, rt, init); + (void) nxt_main_create_worker_process(task, rt, init); } else { nxt_free(init); @@ -730,7 +730,7 @@ nxt_master_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid) static void -nxt_master_port_socket_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) +nxt_main_port_socket_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) { size_t size; nxt_int_t ret; @@ -757,7 +757,7 @@ nxt_master_port_socket_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) nxt_debug(task, "listening socket \"%*s\"", sa->length, nxt_sockaddr_start(sa)); - ret = nxt_master_listening_socket(sa, &ls); + ret = nxt_main_listening_socket(sa, &ls); if (ret == NXT_OK) { nxt_debug(task, "socket(\"%*s\"): %d", @@ -788,7 +788,7 @@ nxt_master_port_socket_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) static nxt_int_t -nxt_master_listening_socket(nxt_sockaddr_t *sa, nxt_listening_socket_t *ls) +nxt_main_listening_socket(nxt_sockaddr_t *sa, nxt_listening_socket_t *ls) { nxt_err_t err; nxt_socket_t s; @@ -935,7 +935,7 @@ static nxt_conf_map_t nxt_app_lang_module_map[] = { static void -nxt_master_port_modules_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) +nxt_main_port_modules_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) { uint32_t index; nxt_mp_t *mp; @@ -1008,10 +1008,10 @@ fail: nxt_mp_destroy(mp); - ret = nxt_master_start_controller_process(task, rt); + ret = nxt_main_start_controller_process(task, rt); if (ret == NXT_OK) { - (void) nxt_master_start_router_process(task, rt); + (void) nxt_main_start_router_process(task, rt); } } diff --git a/src/nxt_master_process.h b/src/nxt_main_process.h index be591c76..d53dabfa 100644 --- a/src/nxt_master_process.h +++ b/src/nxt_main_process.h @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#ifndef _NXT_MASTER_PROCESS_H_INCLUDED_ -#define _NXT_MASTER_PROCESS_H_INCLUDED_ +#ifndef _NXT_MAIN_PROCESS_H_INCLUDED_ +#define _NXT_MAIN_PROCESS_H_INCLUDED_ typedef enum { @@ -19,9 +19,9 @@ typedef enum { } nxt_socket_error_t; -nxt_int_t nxt_master_process_start(nxt_thread_t *thr, nxt_task_t *task, +nxt_int_t nxt_main_process_start(nxt_thread_t *thr, nxt_task_t *task, nxt_runtime_t *runtime); -void nxt_master_stop_worker_processes(nxt_task_t *task, nxt_runtime_t *runtime); +void nxt_main_stop_worker_processes(nxt_task_t *task, nxt_runtime_t *runtime); nxt_int_t nxt_controller_start(nxt_task_t *task, void *data); nxt_int_t nxt_router_start(nxt_task_t *task, void *data); @@ -33,8 +33,8 @@ extern nxt_port_handler_t nxt_worker_process_port_handlers[]; extern nxt_port_handler_t nxt_discovery_process_port_handlers[]; extern nxt_port_handler_t nxt_app_process_port_handlers[]; extern nxt_port_handler_t nxt_router_process_port_handlers[]; -extern const nxt_sig_event_t nxt_master_process_signals[]; +extern const nxt_sig_event_t nxt_main_process_signals[]; extern const nxt_sig_event_t nxt_worker_process_signals[]; -#endif /* _NXT_MASTER_PROCESS_H_INCLUDED_ */ +#endif /* _NXT_MAIN_PROCESS_H_INCLUDED_ */ diff --git a/src/nxt_port.c b/src/nxt_port.c index 358e30f2..1f50caa1 100644 --- a/src/nxt_port.c +++ b/src/nxt_port.c @@ -178,7 +178,7 @@ nxt_port_send_new_port(nxt_task_t *task, nxt_runtime_t *rt, port = nxt_process_port_first(process); - if (port->type == NXT_PROCESS_MASTER || + if (port->type == NXT_PROCESS_MAIN || port->type == NXT_PROCESS_CONTROLLER || port->type == NXT_PROCESS_ROUTER) { @@ -280,7 +280,7 @@ nxt_port_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) rt = task->thread->runtime; - nxt_assert(nxt_runtime_is_master(rt)); + nxt_assert(nxt_runtime_is_main(rt)); process = nxt_runtime_process_get(rt, msg->port_msg.pid); if (nxt_slow_path(process == NULL)) { diff --git a/src/nxt_process.c b/src/nxt_process.c index 81344b2d..473e45ea 100644 --- a/src/nxt_process.c +++ b/src/nxt_process.c @@ -5,7 +5,7 @@ */ #include <nxt_main.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> static void nxt_process_start(nxt_task_t *task, nxt_process_t *process); @@ -93,7 +93,7 @@ static void nxt_process_start(nxt_task_t *task, nxt_process_t *process) { nxt_int_t ret; - nxt_port_t *port, *master_port; + nxt_port_t *port, *main_port; nxt_thread_t *thread; nxt_runtime_t *rt; nxt_process_init_t *init; @@ -125,7 +125,7 @@ nxt_process_start(nxt_task_t *task, nxt_process_t *process) engine = thread->engine; - /* Update inherited master process event engine and signals processing. */ + /* Update inherited main process event engine and signals processing. */ engine->signals->sigev = init->signals; interface = nxt_service_get(rt->services, "engine", rt->engine); @@ -143,10 +143,10 @@ nxt_process_start(nxt_task_t *task, nxt_process_t *process) goto fail; } - master_port = rt->port_by_type[NXT_PROCESS_MASTER]; + main_port = rt->port_by_type[NXT_PROCESS_MAIN]; - nxt_port_read_close(master_port); - nxt_port_write_enable(task, master_port); + nxt_port_read_close(main_port); + nxt_port_write_enable(task, main_port); port = nxt_process_port_first(process); @@ -160,11 +160,11 @@ nxt_process_start(nxt_task_t *task, nxt_process_t *process) nxt_port_enable(task, port, init->port_handlers); - ret = nxt_port_socket_write(task, master_port, NXT_PORT_MSG_READY, + ret = nxt_port_socket_write(task, main_port, NXT_PORT_MSG_READY, -1, init->stream, 0, NULL); if (nxt_slow_path(ret != NXT_OK)) { - nxt_log(task, NXT_LOG_ERR, "failed to send READY message to master"); + nxt_log(task, NXT_LOG_ERR, "failed to send READY message to main"); goto fail; } @@ -420,7 +420,7 @@ nxt_user_cred_get(nxt_task_t *task, nxt_user_cred_t *uc, const char *group) * set by the initgroups() function for a given user. The initgroups() * may block a just forked worker process for some time if LDAP or NDIS+ * is used, so nxt_user_groups_get() allows to get worker user groups in - * master process. In a nutshell the initgroups() calls getgrouplist() + * main process. In a nutshell the initgroups() calls getgrouplist() * followed by setgroups(). However Solaris lacks the getgrouplist(). * Besides getgrouplist() does not allow to query the exact number of * groups while NGROUPS_MAX can be quite large (e.g. 65536 on Linux). diff --git a/src/nxt_process.h b/src/nxt_process.h index 8f33b4af..bbe277f2 100644 --- a/src/nxt_process.h +++ b/src/nxt_process.h @@ -10,7 +10,7 @@ typedef enum { NXT_PROCESS_SINGLE = 0, - NXT_PROCESS_MASTER, + NXT_PROCESS_MAIN, NXT_PROCESS_CONTROLLER, NXT_PROCESS_ROUTER, NXT_PROCESS_WORKER, diff --git a/src/nxt_router.c b/src/nxt_router.c index eadc3498..d6187d86 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -192,7 +192,7 @@ nxt_router_start(nxt_task_t *task, void *data) static nxt_start_worker_t * nxt_router_sw_create(nxt_task_t *task, nxt_app_t *app, nxt_req_app_link_t *ra) { - nxt_port_t *master_port; + nxt_port_t *main_port; nxt_runtime_t *rt; nxt_start_worker_t *sw; @@ -209,19 +209,19 @@ nxt_router_sw_create(nxt_task_t *task, nxt_app_t *app, nxt_req_app_link_t *ra) ra->req_id, &app->name, app); rt = task->thread->runtime; - master_port = rt->port_by_type[NXT_PROCESS_MASTER]; + main_port = rt->port_by_type[NXT_PROCESS_MAIN]; sw->work.handler = nxt_router_send_sw_request; - sw->work.task = &master_port->engine->task; + sw->work.task = &main_port->engine->task; sw->work.obj = sw; sw->work.data = task->thread->engine; sw->work.next = NULL; - if (task->thread->engine != master_port->engine) { - nxt_debug(task, "sw %p post send to master engine %p", sw, - master_port->engine); + if (task->thread->engine != main_port->engine) { + nxt_debug(task, "sw %p post send to main engine %p", sw, + main_port->engine); - nxt_event_engine_post(master_port->engine, &sw->work); + nxt_event_engine_post(main_port->engine, &sw->work); } else { nxt_router_send_sw_request(task, sw, sw->work.data); @@ -1013,7 +1013,7 @@ nxt_router_listen_socket_rpc_create(nxt_task_t *task, skcf->sockaddr->sockaddr_size); rt = task->thread->runtime; - main_port = rt->port_by_type[NXT_PROCESS_MASTER]; + main_port = rt->port_by_type[NXT_PROCESS_MAIN]; router_port = rt->port_by_type[NXT_PROCESS_ROUTER]; stream = nxt_port_rpc_register_handler(task, router_port, @@ -2133,7 +2133,7 @@ nxt_router_send_sw_request(nxt_task_t *task, void *obj, void *data) uint32_t stream; nxt_buf_t *b; nxt_app_t *app; - nxt_port_t *master_port, *router_port; + nxt_port_t *main_port, *router_port; nxt_runtime_t *rt; nxt_start_worker_t *sw; @@ -2158,12 +2158,12 @@ nxt_router_send_sw_request(nxt_task_t *task, void *obj, void *data) nxt_debug(task, "sw %p send", sw); rt = task->thread->runtime; - master_port = rt->port_by_type[NXT_PROCESS_MASTER]; + main_port = rt->port_by_type[NXT_PROCESS_MAIN]; router_port = rt->port_by_type[NXT_PROCESS_ROUTER]; size = app->name.length + 1 + app->conf.length; - b = nxt_buf_mem_alloc(master_port->mem_pool, size, 0); + b = nxt_buf_mem_alloc(main_port->mem_pool, size, 0); nxt_buf_cpystr(b, &app->name); *b->mem.free++ = '\0'; @@ -2172,9 +2172,9 @@ nxt_router_send_sw_request(nxt_task_t *task, void *obj, void *data) stream = nxt_port_rpc_register_handler(task, router_port, nxt_router_sw_ready, nxt_router_sw_error, - master_port->pid, sw); + main_port->pid, sw); - nxt_port_socket_write(task, master_port, NXT_PORT_MSG_START_WORKER, -1, + nxt_port_socket_write(task, main_port, NXT_PORT_MSG_START_WORKER, -1, stream, router_port->id, b); } diff --git a/src/nxt_router.h b/src/nxt_router.h index 6e44f1d8..7071f8c3 100644 --- a/src/nxt_router.h +++ b/src/nxt_router.h @@ -10,7 +10,7 @@ #include <nxt_main.h> #include <nxt_runtime.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> #include <nxt_application.h> diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index 93dad6b6..66647225 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -8,7 +8,7 @@ #include <nxt_main.h> #include <nxt_runtime.h> #include <nxt_port.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> #include <nxt_router.h> @@ -284,7 +284,7 @@ nxt_runtime_event_engines(nxt_task_t *task, nxt_runtime_t *rt) } engine = nxt_event_engine_create(task, interface, - nxt_master_process_signals, 0, 0); + nxt_main_process_signals, 0, 0); if (nxt_slow_path(engine == NULL)) { return NXT_ERROR; @@ -408,8 +408,8 @@ nxt_runtime_initial_start(nxt_task_t *task) thr->engine->max_connections = rt->engine_connections; - if (rt->master_process) { - if (nxt_master_process_start(thr, task, rt) != NXT_ERROR) { + if (rt->main_process) { + if (nxt_main_process_start(thr, task, rt) != NXT_ERROR) { return; } @@ -467,8 +467,8 @@ nxt_runtime_quit(nxt_task_t *task) done = 0; } - if (nxt_runtime_is_master(rt)) { - nxt_master_stop_worker_processes(task, rt); + if (nxt_runtime_is_main(rt)) { + nxt_main_stop_worker_processes(task, rt); done = 0; } } @@ -524,7 +524,7 @@ nxt_runtime_exit(nxt_task_t *task, void *obj, void *data) return; } - if (nxt_runtime_is_master(rt)) { + if (nxt_runtime_is_main(rt)) { if (rt->pid_file != NULL) { nxt_file_delete(rt->pid_file); } @@ -712,7 +712,7 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt) const nxt_event_interface_t *interface; rt->daemon = 1; - rt->master_process = 1; + rt->main_process = 1; rt->engine_connections = 256; rt->auxiliary_threads = 2; rt->user_cred.user = NXT_USER; diff --git a/src/nxt_runtime.h b/src/nxt_runtime.h index f6d6aa53..b491002e 100644 --- a/src/nxt_runtime.h +++ b/src/nxt_runtime.h @@ -49,7 +49,7 @@ struct nxt_runtime_s { uint8_t daemon; uint8_t batch; - uint8_t master_process; + uint8_t main_process; const char *engine; uint32_t engine_connections; uint32_t auxiliary_threads; @@ -89,9 +89,9 @@ nxt_runtime_is_type(nxt_runtime_t *rt, nxt_process_type_t type) nxt_inline nxt_bool_t -nxt_runtime_is_master(nxt_runtime_t *rt) +nxt_runtime_is_main(nxt_runtime_t *rt) { - return nxt_runtime_is_type(rt, NXT_PROCESS_MASTER); + return nxt_runtime_is_type(rt, NXT_PROCESS_MAIN); } diff --git a/src/nxt_worker_process.c b/src/nxt_worker_process.c index 59290d0b..0d7ae796 100644 --- a/src/nxt_worker_process.c +++ b/src/nxt_worker_process.c @@ -7,7 +7,7 @@ #include <nxt_main.h> #include <nxt_runtime.h> #include <nxt_port.h> -#include <nxt_master_process.h> +#include <nxt_main_process.h> #include <nxt_router.h> |