summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2019-08-16 14:55:18 +0300
committerMax Romanov <max.romanov@nginx.com>2019-08-16 14:55:18 +0300
commit686f5b1436a318135f288b563cb6e97fcdc9d8f8 (patch)
tree5225359ed232613c8ea37d91feec19d7cd45ee21 /src/nxt_router.c
parent29911538ea91705fcdcbcf0e271cfbc5c8ed674b (diff)
downloadunit-686f5b1436a318135f288b563cb6e97fcdc9d8f8.tar.gz
unit-686f5b1436a318135f288b563cb6e97fcdc9d8f8.tar.bz2
Changing the sequence of body send execution.
Request state ready_handler required for further websocket events processing. It is not required for regular response transferring.
Diffstat (limited to '')
-rw-r--r--src/nxt_router.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 509f487a..566e0c65 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -3540,9 +3540,14 @@ nxt_router_response_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg,
nxt_buf_chain_add(&r->out, b);
}
+ nxt_http_request_header_send(task, r);
+
r->state = &nxt_http_request_send_state;
- nxt_http_request_header_send(task, r);
+ if (r->out) {
+ nxt_work_queue_add(&task->thread->engine->fast_work_queue,
+ nxt_http_request_send_body, task, r, NULL);
+ }
}
return;
@@ -3558,7 +3563,6 @@ fail:
static const nxt_http_request_state_t nxt_http_request_send_state
nxt_aligned(64) =
{
- .ready_handler = nxt_http_request_send_body,
.error_handler = nxt_http_request_error_handler,
};