Introduced chained buffer completion handlers.

This commit is contained in:
Igor Sysoev
2019-11-14 16:39:48 +03:00
parent 643c433f8e
commit 57e326b411
9 changed files with 115 additions and 33 deletions

View File

@@ -483,15 +483,20 @@ nxt_http_buf_mem(nxt_task_t *task, nxt_http_request_t *r, size_t size)
static void
nxt_http_request_mem_buf_completion(nxt_task_t *task, void *obj, void *data)
{
nxt_buf_t *b;
nxt_buf_t *b, *next;
nxt_http_request_t *r;
b = obj;
r = data;
nxt_mp_free(r->mem_pool, b);
do {
next = b->next;
nxt_mp_release(r->mem_pool);
nxt_mp_free(r->mem_pool, b);
nxt_mp_release(r->mem_pool);
b = next;
} while (b != NULL);
}