summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port_memory.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-08-02 13:36:29 +0300
committerMax Romanov <max.romanov@nginx.com>2017-08-02 13:36:29 +0300
commitb150f07e801802124ca6f3b29b4b9f97aa68d52b (patch)
tree6dbf83af6b7e2787e0c918b0017765d074c70057 /src/nxt_port_memory.c
parentf23f985899760fafd853e993d9023b1339f09533 (diff)
downloadunit-b150f07e801802124ca6f3b29b4b9f97aa68d52b.tar.gz
unit-b150f07e801802124ca6f3b29b4b9f97aa68d52b.tar.bz2
Added basic port error handler.
Diffstat (limited to '')
-rw-r--r--src/nxt_port_memory.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c
index ec3227b1..e714b654 100644
--- a/src/nxt_port_memory.c
+++ b/src/nxt_port_memory.c
@@ -568,7 +568,7 @@ nxt_port_mmap_write(nxt_task_t *task, nxt_port_t *port,
nxt_port_send_msg_t *msg, nxt_sendbuf_coalesce_t *sb)
{
size_t bsize;
- nxt_buf_t *b, *bmem;
+ nxt_buf_t *bmem;
nxt_uint_t i;
nxt_port_mmap_msg_t *mmap_msg;
nxt_port_mmap_header_t *hdr;
@@ -577,13 +577,8 @@ nxt_port_mmap_write(nxt_task_t *task, nxt_port_t *port,
"via shared memory", sb->size, port->pid);
bsize = sb->niov * sizeof(nxt_port_mmap_msg_t);
+ mmap_msg = port->mmsg_buf;
- b = nxt_buf_mem_ts_alloc(task, port->mem_pool, bsize);
- if (nxt_slow_path(b == NULL)) {
- return;
- }
-
- mmap_msg = (nxt_port_mmap_msg_t *) b->mem.start;
bmem = msg->buf;
for (i = 0; i < sb->niov; i++, mmap_msg++) {
@@ -611,10 +606,7 @@ nxt_port_mmap_write(nxt_task_t *task, nxt_port_t *port,
port->pid);
}
- msg->buf = b;
- b->mem.free += bsize;
-
- sb->iobuf[0].iov_base = b->mem.pos;
+ sb->iobuf[0].iov_base = port->mmsg_buf;
sb->iobuf[0].iov_len = bsize;
sb->niov = 1;
sb->size = bsize;