diff options
author | Igor Sysoev <igor@sysoev.ru> | 2018-04-03 16:28:26 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2018-04-03 16:28:26 +0300 |
commit | fa04c05aa0e67e6964ab006935f939c6b27754a3 (patch) | |
tree | 969d3dac0bda996a487dc6e58e3b1e2ef7f91946 /src/nxt_router.c | |
parent | 151160c1103166810daddf1e9cc7135cb6ccc321 (diff) | |
download | unit-fa04c05aa0e67e6964ab006935f939c6b27754a3.tar.gz unit-fa04c05aa0e67e6964ab006935f939c6b27754a3.tar.bz2 |
HTTP: using r->mem_pool retention counter for response buffers.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_router.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 57e3cff1..994ba4af 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -2636,7 +2636,7 @@ nxt_router_response_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg, { size_t dump_size; nxt_int_t ret; - nxt_buf_t *b, *last; + nxt_buf_t *b; nxt_http_request_t *r; nxt_req_conn_link_t *rc; nxt_app_parse_ctx_t *ar; @@ -2663,17 +2663,16 @@ nxt_router_response_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg, return; } + if (ar->request->error) { + nxt_app_http_req_done(task, ar); + nxt_router_rc_unlink(task, rc); + return; + } + if (msg->port_msg.last != 0) { nxt_debug(task, "router data create last buf"); - last = nxt_http_request_last_buffer(task, ar->request); - if (nxt_slow_path(last == NULL)) { - nxt_app_http_req_done(task, ar); - nxt_router_rc_unlink(task, rc); - return; - } - - nxt_buf_chain_add(&b, last); + nxt_buf_chain_add(&b, nxt_http_buf_last(ar->request)); nxt_router_rc_unlink(task, rc); |