diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-09-15 20:30:34 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-09-15 20:30:34 +0300 |
commit | 838d9946ac2d9c9a9ba41d5b88209bfc5f2325d0 (patch) | |
tree | cd6458cb2362ef2550fc5629407f5f623c11945f /src/nxt_worker_process.c | |
parent | 1449e27cb42a5b3ca2d2106a39fee3f1d54a340e (diff) | |
download | unit-838d9946ac2d9c9a9ba41d5b88209bfc5f2325d0.tar.gz unit-838d9946ac2d9c9a9ba41d5b88209bfc5f2325d0.tar.bz2 |
Introducing named port message handlers to avoid misprints.
Diffstat (limited to 'src/nxt_worker_process.c')
-rw-r--r-- | src/nxt_worker_process.c | 84 |
1 files changed, 25 insertions, 59 deletions
diff --git a/src/nxt_worker_process.c b/src/nxt_worker_process.c index 1a7d0c53..c66eb179 100644 --- a/src/nxt_worker_process.c +++ b/src/nxt_worker_process.c @@ -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, }; |