nxt_router.c (1828:c548e46fe516) nxt_router.c (1829:8fb5cbfe761a)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_router.h>

--- 509 unchanged lines hidden (view full) ---

518 nxt_debug(task, "stream #%uD: cancelled by router",
519 req_rpc_data->stream);
520 }
521
522 for (b = msg_info->buf; b != NULL; b = next) {
523 next = b->next;
524 b->next = NULL;
525
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_router.h>

--- 509 unchanged lines hidden (view full) ---

518 nxt_debug(task, "stream #%uD: cancelled by router",
519 req_rpc_data->stream);
520 }
521
522 for (b = msg_info->buf; b != NULL; b = next) {
523 next = b->next;
524 b->next = NULL;
525
526 b->completion_handler = msg_info->completion_handler;
527
528 if (b->is_port_mmap_sent) {
529 b->is_port_mmap_sent = cancelled == 0;
526 if (b->is_port_mmap_sent) {
527 b->is_port_mmap_sent = cancelled == 0;
530 b->completion_handler(task, b, b->parent);
531 }
528 }
529
530 b->completion_handler(task, b, b->parent);
532 }
533
534 msg_info->buf = NULL;
535
536 return cancelled;
537}
538
539

--- 3568 unchanged lines hidden (view full) ---

4108
4109 req_rpc_data->app_port = app_port;
4110
4111 b = req_rpc_data->msg_info.buf;
4112
4113 if (b != NULL) {
4114 /* First buffer is already sent. Start from second. */
4115 b = b->next;
531 }
532
533 msg_info->buf = NULL;
534
535 return cancelled;
536}
537
538

--- 3568 unchanged lines hidden (view full) ---

4107
4108 req_rpc_data->app_port = app_port;
4109
4110 b = req_rpc_data->msg_info.buf;
4111
4112 if (b != NULL) {
4113 /* First buffer is already sent. Start from second. */
4114 b = b->next;
4115
4116 req_rpc_data->msg_info.buf->next = NULL;
4116 }
4117
4118 if (req_rpc_data->msg_info.body_fd != -1 || b != NULL) {
4119 nxt_debug(task, "stream #%uD: send body fd %d", req_rpc_data->stream,
4120 req_rpc_data->msg_info.body_fd);
4121
4122 if (req_rpc_data->msg_info.body_fd != -1) {
4123 lseek(req_rpc_data->msg_info.body_fd, 0, SEEK_SET);

--- 896 unchanged lines hidden (view full) ---

5020 return;
5021 }
5022
5023 nxt_debug(task, "about to send %O bytes buffer to app process port %d",
5024 nxt_buf_used_size(buf),
5025 port->socket.fd);
5026
5027 req_rpc_data->msg_info.buf = buf;
4117 }
4118
4119 if (req_rpc_data->msg_info.body_fd != -1 || b != NULL) {
4120 nxt_debug(task, "stream #%uD: send body fd %d", req_rpc_data->stream,
4121 req_rpc_data->msg_info.body_fd);
4122
4123 if (req_rpc_data->msg_info.body_fd != -1) {
4124 lseek(req_rpc_data->msg_info.body_fd, 0, SEEK_SET);

--- 896 unchanged lines hidden (view full) ---

5021 return;
5022 }
5023
5024 nxt_debug(task, "about to send %O bytes buffer to app process port %d",
5025 nxt_buf_used_size(buf),
5026 port->socket.fd);
5027
5028 req_rpc_data->msg_info.buf = buf;
5028 req_rpc_data->msg_info.completion_handler = buf->completion_handler;
5029
5029
5030 do {
5031 buf->completion_handler = nxt_router_dummy_buf_completion;
5032 buf = buf->next;
5033 } while (buf != NULL);
5034
5035 buf = req_rpc_data->msg_info.buf;
5036
5037 body = req_rpc_data->request->body;
5038
5039 if (body != NULL && nxt_buf_is_file(body)) {
5040 req_rpc_data->msg_info.body_fd = body->file->fd;
5041
5042 body->file->fd = -1;
5043
5044 } else {

--- 586 unchanged lines hidden ---
5030 body = req_rpc_data->request->body;
5031
5032 if (body != NULL && nxt_buf_is_file(body)) {
5033 req_rpc_data->msg_info.body_fd = body->file->fd;
5034
5035 body->file->fd = -1;
5036
5037 } else {

--- 586 unchanged lines hidden ---