summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nxt_port_socket.c3
-rw-r--r--src/nxt_sendbuf.c4
-rw-r--r--src/nxt_sendbuf.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c
index 01e46f93..de11549b 100644
--- a/src/nxt_port_socket.c
+++ b/src/nxt_port_socket.c
@@ -308,7 +308,8 @@ nxt_port_write_handler(nxt_task_t *task, void *obj, void *data)
wq = &task->thread->engine->fast_work_queue;
- msg->buf = nxt_sendbuf_completion(task, wq, msg->buf, plain_size);
+ msg->buf = nxt_sendbuf_completion(task, wq, msg->buf, plain_size,
+ m == NXT_PORT_METHOD_MMAP);
if (msg->buf != NULL) {
/*
diff --git a/src/nxt_sendbuf.c b/src/nxt_sendbuf.c
index 361cb0cd..2a529c14 100644
--- a/src/nxt_sendbuf.c
+++ b/src/nxt_sendbuf.c
@@ -373,7 +373,7 @@ nxt_sendbuf_update(nxt_buf_t *b, size_t sent)
nxt_buf_t *
nxt_sendbuf_completion(nxt_task_t *task, nxt_work_queue_t *wq, nxt_buf_t *b,
- size_t sent)
+ size_t sent, nxt_bool_t mmap_mode)
{
size_t size;
@@ -391,7 +391,7 @@ nxt_sendbuf_completion(nxt_task_t *task, nxt_work_queue_t *wq, nxt_buf_t *b,
break;
}
- if (nxt_buf_is_port_mmap(b)) {
+ if (nxt_buf_is_port_mmap(b) && mmap_mode) {
/*
* buffer has been sent to other side which is now
* responsible for shared memory bucket release
diff --git a/src/nxt_sendbuf.h b/src/nxt_sendbuf.h
index b159bfe5..03da2c5d 100644
--- a/src/nxt_sendbuf.h
+++ b/src/nxt_sendbuf.h
@@ -121,7 +121,7 @@ ssize_t nxt_sendbuf_copy_coalesce(nxt_conn_t *c, nxt_buf_mem_t *bm,
nxt_buf_t *nxt_sendbuf_update(nxt_buf_t *b, size_t sent);
nxt_buf_t *nxt_sendbuf_completion(nxt_task_t *task, nxt_work_queue_t *wq,
- nxt_buf_t *b, size_t sent);
+ nxt_buf_t *b, size_t sent, nxt_bool_t mmap_mode);
#endif /* _NXT_SENDBUF_H_INCLUDED_ */