summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-09-29 22:57:56 +0300
committerMax Romanov <max.romanov@nginx.com>2020-09-29 22:57:56 +0300
commitc721a5378dd467054f672a40e677be56bad53c4d (patch)
tree63a670b9aafc33ca2d2fced0a76f564d6734922e /src/nxt_router.c
parentc4b000f9cc377b6a13777eb10e858c90de6264fe (diff)
downloadunit-c721a5378dd467054f672a40e677be56bad53c4d.tar.gz
unit-c721a5378dd467054f672a40e677be56bad53c4d.tar.bz2
Fixing request buffer memory leakage in router.
The issue was introduced in changeset 1d84b9e4b459. The request buffer was transferred via the shared application queue, but the buffer position and the 'sent' flag were not updated after the buffer had been sent.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index b7408c3c..a3218047 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -4941,6 +4941,9 @@ nxt_router_app_prepare_request(nxt_task_t *task,
nxt_debug(task, "queue is not empty");
}
+ buf->is_port_mmap_sent = 1;
+ buf->mem.pos = buf->mem.free;
+
} else {
nxt_alert(task, "stream #%uD, app '%V': failed to send app message",
req_rpc_data->stream, &app->name);