summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port_socket.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-07-07 16:01:34 +0300
committerMax Romanov <max.romanov@nginx.com>2017-07-07 16:01:34 +0300
commit74cda90e31f97ba0ebd6483f2b073c1240b93a58 (patch)
tree69727640f476822e3cc1e40ac09bf645251617be /src/nxt_port_socket.c
parent61008a7c0b45fe55f3f611c61f81e569e6baee30 (diff)
downloadunit-74cda90e31f97ba0ebd6483f2b073c1240b93a58.tar.gz
unit-74cda90e31f97ba0ebd6483f2b073c1240b93a58.tar.bz2
Process stop notification from master to all other processes.
New port message type introduced NXT_PORT_MSG_REMOVE_PID. Default handler removes process description from nxt_runtime_t with all ports, incoming and outgoing mmaps etc.
Diffstat (limited to 'src/nxt_port_socket.c')
-rw-r--r--src/nxt_port_socket.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c
index 73bb44bd..883c45bb 100644
--- a/src/nxt_port_socket.c
+++ b/src/nxt_port_socket.c
@@ -222,7 +222,7 @@ nxt_port_socket_write(nxt_task_t *task, nxt_port_t *port, nxt_uint_t type,
nxt_queue_insert_tail(&port->messages, &msg->link);
if (port->socket.write_ready) {
- nxt_port_write_handler(task, port, NULL);
+ nxt_port_write_handler(task, &port->socket, NULL);
}
return NXT_OK;
@@ -236,14 +236,14 @@ nxt_port_write_handler(nxt_task_t *task, void *obj, void *data)
nxt_port_t *port;
struct iovec iov[NXT_IOBUF_MAX * 10];
nxt_queue_link_t *link;
+ nxt_port_method_t m;
nxt_port_send_msg_t *msg;
nxt_sendbuf_coalesce_t sb;
- nxt_port_method_t m;
size_t plain_size;
nxt_buf_t *plain_buf;
- port = obj;
+ port = nxt_container_of(obj, nxt_port_t, socket);
do {
link = nxt_queue_first(&port->messages);
@@ -389,7 +389,7 @@ nxt_port_read_handler(nxt_task_t *task, void *obj, void *data)
struct iovec iov[2];
nxt_port_recv_msg_t msg;
- port = msg.port = obj;
+ port = msg.port = nxt_container_of(obj, nxt_port_t, socket);
for ( ;; ) {
@@ -522,5 +522,6 @@ nxt_port_buf_free(nxt_port_t *port, nxt_buf_t *b)
static void
nxt_port_error_handler(nxt_task_t *task, void *obj, void *data)
{
+ nxt_debug(task, "port error handler %p", obj);
/* TODO */
}