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.
This commit is contained in:
Max Romanov
2020-09-29 22:57:56 +03:00
parent c4b000f9cc
commit c721a5378d

View File

@@ -4941,6 +4941,9 @@ nxt_router_app_prepare_request(nxt_task_t *task,
nxt_debug(task, "queue is not empty"); nxt_debug(task, "queue is not empty");
} }
buf->is_port_mmap_sent = 1;
buf->mem.pos = buf->mem.free;
} else { } else {
nxt_alert(task, "stream #%uD, app '%V': failed to send app message", nxt_alert(task, "stream #%uD, app '%V': failed to send app message",
req_rpc_data->stream, &app->name); req_rpc_data->stream, &app->name);