Introducing named port message handlers to avoid misprints.

This commit is contained in:
Max Romanov
2017-09-15 20:30:34 +03:00
parent 1449e27cb4
commit 838d9946ac
10 changed files with 134 additions and 146 deletions

View File

@@ -20,71 +20,37 @@ static void nxt_worker_process_sigquit_handler(nxt_task_t *task, void *obj,
void *data);
nxt_port_handler_t nxt_worker_process_port_handlers[] = {
nxt_worker_process_quit_handler,
nxt_port_new_port_handler,
nxt_port_change_log_file_handler,
nxt_port_mmap_handler,
nxt_port_data_handler,
nxt_port_remove_pid_handler,
NULL, /* NXT_PORT_MSG_READY */
NULL, /* NXT_PORT_MSG_START_WORKER */
NULL, /* NXT_PORT_MSG_SOCKET */
NULL, /* NXT_PORT_MSG_MODULES */
NULL, /* NXT_PORT_MSG_CONF_STORE */
nxt_port_rpc_handler,
nxt_port_rpc_handler,
nxt_port_handlers_t nxt_app_process_port_handlers = {
.quit = nxt_worker_process_quit_handler,
.new_port = nxt_port_new_port_handler,
.change_file = nxt_port_change_log_file_handler,
.mmap = nxt_port_mmap_handler,
.data = nxt_port_app_data_handler,
.remove_pid = nxt_port_remove_pid_handler,
};
nxt_port_handler_t nxt_app_process_port_handlers[] = {
nxt_worker_process_quit_handler,
nxt_port_new_port_handler,
nxt_port_change_log_file_handler,
nxt_port_mmap_handler,
nxt_port_app_data_handler,
nxt_port_remove_pid_handler,
NULL, /* NXT_PORT_MSG_READY */
NULL, /* NXT_PORT_MSG_START_WORKER */
NULL, /* NXT_PORT_MSG_SOCKET */
NULL, /* NXT_PORT_MSG_MODULES */
NULL, /* NXT_PORT_MSG_CONF_STORE */
nxt_port_rpc_handler,
nxt_port_rpc_handler,
nxt_port_handlers_t nxt_router_process_port_handlers = {
.quit = nxt_worker_process_quit_handler,
.new_port = nxt_router_new_port_handler,
.change_file = nxt_port_change_log_file_handler,
.mmap = nxt_port_mmap_handler,
.data = nxt_router_conf_data_handler,
.remove_pid = nxt_router_remove_pid_handler,
.rpc_ready = nxt_port_rpc_handler,
.rpc_error = nxt_port_rpc_handler,
};
nxt_port_handler_t nxt_router_process_port_handlers[] = {
nxt_worker_process_quit_handler,
nxt_router_new_port_handler,
nxt_port_change_log_file_handler,
nxt_port_mmap_handler,
nxt_router_conf_data_handler,
nxt_router_remove_pid_handler,
NULL, /* NXT_PORT_MSG_READY */
NULL, /* NXT_PORT_MSG_START_WORKER */
NULL, /* NXT_PORT_MSG_SOCKET */
NULL, /* NXT_PORT_MSG_MODULES */
NULL, /* NXT_PORT_MSG_CONF_STORE */
nxt_port_rpc_handler,
nxt_port_rpc_handler,
};
nxt_port_handler_t nxt_discovery_process_port_handlers[] = {
nxt_worker_process_quit_handler,
nxt_port_new_port_handler,
nxt_port_change_log_file_handler,
nxt_port_mmap_handler,
nxt_port_data_handler,
nxt_port_remove_pid_handler,
NULL, /* NXT_PORT_MSG_READY */
NULL, /* NXT_PORT_MSG_START_WORKER */
NULL, /* NXT_PORT_MSG_SOCKET */
NULL, /* NXT_PORT_MSG_MODULES */
NULL, /* NXT_PORT_MSG_CONF_STORE */
nxt_port_rpc_handler,
nxt_port_rpc_handler,
nxt_port_handlers_t nxt_discovery_process_port_handlers = {
.quit = nxt_worker_process_quit_handler,
.new_port = nxt_port_new_port_handler,
.change_file = nxt_port_change_log_file_handler,
.mmap = nxt_port_mmap_handler,
.data = nxt_port_data_handler,
.remove_pid = nxt_port_remove_pid_handler,
.rpc_ready = nxt_port_rpc_handler,
.rpc_error = nxt_port_rpc_handler,
};