diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-08-02 13:21:32 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-08-02 13:21:32 +0300 |
commit | 9367dd2bf8982d7dbe5e8c71643d3e5d5ee494e1 (patch) | |
tree | eb8b27d0f4faa8f630b6d1ec935f369d478d56ba /src/nxt_router.c | |
parent | bcf99f87e25d3702ec01595a5cf3e91c00cc6a98 (diff) | |
download | unit-9367dd2bf8982d7dbe5e8c71643d3e5d5ee494e1.tar.gz unit-9367dd2bf8982d7dbe5e8c71643d3e5d5ee494e1.tar.bz2 |
Implicit port read buffer completion.
To disable implicit completion, handler should reset msg->buf field.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r-- | src/nxt_router.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 4cf476f6..7c197a44 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -333,8 +333,6 @@ nxt_router_conf_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) ret = nxt_router_conf_new(task, tmcf, b->mem.pos, b->mem.free); - b->mem.pos = b->mem.free; - if (ret == NXT_OK) { nxt_router_conf_success(task, tmcf); return; @@ -1735,7 +1733,7 @@ static void nxt_router_app_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) { size_t dump_size; - nxt_buf_t *b, *i, *last; + nxt_buf_t *b, *last; nxt_conn_t *c; nxt_req_conn_link_t *rc; nxt_event_engine_t *engine; @@ -1748,11 +1746,6 @@ nxt_router_app_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) nxt_debug(task, "request id %08uxD not found", msg->port_msg.stream); - /* Mark buffers as read. */ - for (i = b; i != NULL; i = i->next) { - i->mem.pos = i->mem.free; - } - return; } @@ -1793,6 +1786,9 @@ nxt_router_app_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) return; } + /* Disable instant buffer completion/re-using by port. */ + msg->buf = NULL; + if (c->write == NULL) { c->write = b; c->write_state = &nxt_router_conn_write_state; |