summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_router.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index fbc9a4c8..95c8c160 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -3912,6 +3912,7 @@ nxt_router_req_headers_ack_handler(nxt_task_t *task,
{
int res;
nxt_app_t *app;
+ nxt_buf_t *b;
nxt_bool_t start_process, unlinked;
nxt_port_t *app_port, *main_app_port, *idle_port;
nxt_queue_link_t *idle_lnk;
@@ -4009,16 +4010,25 @@ nxt_router_req_headers_ack_handler(nxt_task_t *task,
req_rpc_data->app_port = app_port;
- if (req_rpc_data->msg_info.body_fd != -1) {
+ b = req_rpc_data->msg_info.buf;
+
+ if (b != NULL) {
+ /* First buffer is already sent. Start from second. */
+ b = b->next;
+ }
+
+ if (req_rpc_data->msg_info.body_fd != -1 || b != NULL) {
nxt_debug(task, "stream #%uD: send body fd %d", req_rpc_data->stream,
req_rpc_data->msg_info.body_fd);
- lseek(req_rpc_data->msg_info.body_fd, 0, SEEK_SET);
+ if (req_rpc_data->msg_info.body_fd != -1) {
+ lseek(req_rpc_data->msg_info.body_fd, 0, SEEK_SET);
+ }
res = nxt_port_socket_write(task, app_port, NXT_PORT_MSG_REQ_BODY,
req_rpc_data->msg_info.body_fd,
req_rpc_data->stream,
- task->thread->engine->port->id, NULL);
+ task->thread->engine->port->id, b);
if (nxt_slow_path(res != NXT_OK)) {
nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR);