nxt_port.c (167:06ebbe0a5c07) nxt_port.c (190:0dbd1ceae3a2)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_runtime.h>

--- 20 unchanged lines hidden (view full) ---

29
30 port = nxt_mp_zalloc(mp, sizeof(nxt_port_t));
31
32 if (nxt_fast_path(port != NULL)) {
33 port->id = id;
34 port->pid = pid;
35 port->type = type;
36 port->mem_pool = mp;
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_runtime.h>

--- 20 unchanged lines hidden (view full) ---

29
30 port = nxt_mp_zalloc(mp, sizeof(nxt_port_t));
31
32 if (nxt_fast_path(port != NULL)) {
33 port->id = id;
34 port->pid = pid;
35 port->type = type;
36 port->mem_pool = mp;
37 port->next_stream = 1;
37
38 nxt_queue_init(&port->messages);
39
40 } else {
41 nxt_mp_destroy(mp);
42 }
43
44 nxt_thread_log_debug("port %p %d:%d new, type %d", port, pid, id, type);

--- 371 unchanged lines hidden (view full) ---

416 nxt_runtime_t *rt;
417 nxt_process_t *process;
418
419 nxt_debug(task, "port remove pid handler");
420
421 rt = task->thread->runtime;
422 pid = msg->port_msg.stream;
423
38
39 nxt_queue_init(&port->messages);
40
41 } else {
42 nxt_mp_destroy(mp);
43 }
44
45 nxt_thread_log_debug("port %p %d:%d new, type %d", port, pid, id, type);

--- 371 unchanged lines hidden (view full) ---

417 nxt_runtime_t *rt;
418 nxt_process_t *process;
419
420 nxt_debug(task, "port remove pid handler");
421
422 rt = task->thread->runtime;
423 pid = msg->port_msg.stream;
424
425 nxt_port_rpc_remove_peer(task, msg->port, pid);
426
424 process = nxt_runtime_process_find(rt, pid);
425
426 if (process) {
427 nxt_runtime_process_remove(rt, process);
428 }
429}
430
431
432void
433nxt_port_empty_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
434{
435 nxt_debug(task, "port empty handler");
436}
427 process = nxt_runtime_process_find(rt, pid);
428
429 if (process) {
430 nxt_runtime_process_remove(rt, process);
431 }
432}
433
434
435void
436nxt_port_empty_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
437{
438 nxt_debug(task, "port empty handler");
439}