Process port refactoring.
- Introduced nxt_runtime_process_port_create(). - Moved nxt_process_use() into nxt_process.c from nxt_runtime.c. - Renamed nxt_runtime_process_remove_pid() as nxt_runtime_process_remove(). - Some public functions transformed to static. This closes #327 issue on GitHub.
This commit is contained in:
@@ -238,7 +238,6 @@ void
|
||||
nxt_port_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
{
|
||||
nxt_port_t *port;
|
||||
nxt_process_t *process;
|
||||
nxt_runtime_t *rt;
|
||||
nxt_port_msg_new_port_t *new_port_msg;
|
||||
|
||||
@@ -261,22 +260,13 @@ nxt_port_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
return;
|
||||
}
|
||||
|
||||
process = nxt_runtime_process_get(rt, new_port_msg->pid);
|
||||
if (nxt_slow_path(process == NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
port = nxt_port_new(task, new_port_msg->id, new_port_msg->pid,
|
||||
new_port_msg->type);
|
||||
port = nxt_runtime_process_port_create(task, rt, new_port_msg->pid,
|
||||
new_port_msg->id,
|
||||
new_port_msg->type);
|
||||
if (nxt_slow_path(port == NULL)) {
|
||||
nxt_process_use(task, process, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
nxt_process_port_add(task, process, port);
|
||||
|
||||
nxt_process_use(task, process, -1);
|
||||
|
||||
nxt_fd_nonblocking(task, msg->fd);
|
||||
|
||||
port->pair[0] = -1;
|
||||
@@ -286,10 +276,6 @@ nxt_port_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
|
||||
port->socket.task = task;
|
||||
|
||||
nxt_runtime_port_add(task, port);
|
||||
|
||||
nxt_port_use(task, port, -1);
|
||||
|
||||
nxt_port_write_enable(task, port);
|
||||
|
||||
msg->u.new_port = port;
|
||||
|
||||
Reference in New Issue
Block a user