nxt_router.c (1936:953434450ea9) nxt_router.c (1940:29c2c9d80c5b)
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>

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

232 nxt_apr_action_t action);
233static void nxt_router_app_port_get(nxt_task_t *task, nxt_app_t *app,
234 nxt_request_rpc_data_t *req_rpc_data);
235static void nxt_router_http_request_error(nxt_task_t *task, void *obj,
236 void *data);
237static void nxt_router_http_request_done(nxt_task_t *task, void *obj,
238 void *data);
239
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>

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

232 nxt_apr_action_t action);
233static void nxt_router_app_port_get(nxt_task_t *task, nxt_app_t *app,
234 nxt_request_rpc_data_t *req_rpc_data);
235static void nxt_router_http_request_error(nxt_task_t *task, void *obj,
236 void *data);
237static void nxt_router_http_request_done(nxt_task_t *task, void *obj,
238 void *data);
239
240static void nxt_router_dummy_buf_completion(nxt_task_t *task, void *obj,
241 void *data);
242static void nxt_router_app_prepare_request(nxt_task_t *task,
243 nxt_request_rpc_data_t *req_rpc_data);
244static nxt_buf_t *nxt_router_prepare_msg(nxt_task_t *task,
245 nxt_http_request_t *r, nxt_app_t *app, const nxt_str_t *prefix);
246
247static void nxt_router_app_timeout(nxt_task_t *task, void *obj, void *data);
248static void nxt_router_adjust_idle_timer(nxt_task_t *task, void *obj,
249 void *data);

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

2527
2528 size = nxt_sockaddr_size(skcf->listen->sockaddr);
2529
2530 b = nxt_buf_mem_alloc(tmcf->mem_pool, size, 0);
2531 if (b == NULL) {
2532 goto fail;
2533 }
2534
240static void nxt_router_app_prepare_request(nxt_task_t *task,
241 nxt_request_rpc_data_t *req_rpc_data);
242static nxt_buf_t *nxt_router_prepare_msg(nxt_task_t *task,
243 nxt_http_request_t *r, nxt_app_t *app, const nxt_str_t *prefix);
244
245static void nxt_router_app_timeout(nxt_task_t *task, void *obj, void *data);
246static void nxt_router_adjust_idle_timer(nxt_task_t *task, void *obj,
247 void *data);

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

2525
2526 size = nxt_sockaddr_size(skcf->listen->sockaddr);
2527
2528 b = nxt_buf_mem_alloc(tmcf->mem_pool, size, 0);
2529 if (b == NULL) {
2530 goto fail;
2531 }
2532
2535 b->completion_handler = nxt_router_dummy_buf_completion;
2533 b->completion_handler = nxt_buf_dummy_completion;
2536
2537 b->mem.free = nxt_cpymem(b->mem.free, skcf->listen->sockaddr, size);
2538
2539 rt = task->thread->runtime;
2540 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
2541 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];
2542
2543 stream = nxt_port_rpc_register_handler(task, router_port,

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

2758
2759 size = app->name.length + 1 + app->conf.length;
2760
2761 b = nxt_buf_mem_alloc(tmcf->mem_pool, size, 0);
2762 if (nxt_slow_path(b == NULL)) {
2763 goto fail;
2764 }
2765
2534
2535 b->mem.free = nxt_cpymem(b->mem.free, skcf->listen->sockaddr, size);
2536
2537 rt = task->thread->runtime;
2538 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
2539 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];
2540
2541 stream = nxt_port_rpc_register_handler(task, router_port,

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

2756
2757 size = app->name.length + 1 + app->conf.length;
2758
2759 b = nxt_buf_mem_alloc(tmcf->mem_pool, size, 0);
2760 if (nxt_slow_path(b == NULL)) {
2761 goto fail;
2762 }
2763
2766 b->completion_handler = nxt_router_dummy_buf_completion;
2764 b->completion_handler = nxt_buf_dummy_completion;
2767
2768 nxt_buf_cpystr(b, &app->name);
2769 *b->mem.free++ = '\0';
2770 nxt_buf_cpystr(b, &app->conf);
2771
2772 rt = task->thread->runtime;
2773 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
2774 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];

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

3787
3788 access_log = tmcf->router_conf->access_log;
3789
3790 b = nxt_buf_mem_alloc(tmcf->mem_pool, access_log->path.length + 1, 0);
3791 if (nxt_slow_path(b == NULL)) {
3792 goto fail;
3793 }
3794
2765
2766 nxt_buf_cpystr(b, &app->name);
2767 *b->mem.free++ = '\0';
2768 nxt_buf_cpystr(b, &app->conf);
2769
2770 rt = task->thread->runtime;
2771 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
2772 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];

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

3785
3786 access_log = tmcf->router_conf->access_log;
3787
3788 b = nxt_buf_mem_alloc(tmcf->mem_pool, access_log->path.length + 1, 0);
3789 if (nxt_slow_path(b == NULL)) {
3790 goto fail;
3791 }
3792
3795 b->completion_handler = nxt_router_dummy_buf_completion;
3793 b->completion_handler = nxt_buf_dummy_completion;
3796
3797 nxt_buf_cpystr(b, &access_log->path);
3798 *b->mem.free++ = '\0';
3799
3800 rt = task->thread->runtime;
3801 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
3802 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];
3803

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

5238 nxt_request_rpc_data_unlink(task, r->req_rpc_data);
5239 }
5240
5241 nxt_http_request_close_handler(task, r, r->proto.any);
5242}
5243
5244
5245static void
3794
3795 nxt_buf_cpystr(b, &access_log->path);
3796 *b->mem.free++ = '\0';
3797
3798 rt = task->thread->runtime;
3799 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
3800 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];
3801

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

5236 nxt_request_rpc_data_unlink(task, r->req_rpc_data);
5237 }
5238
5239 nxt_http_request_close_handler(task, r, r->proto.any);
5240}
5241
5242
5243static void
5246nxt_router_dummy_buf_completion(nxt_task_t *task, void *obj, void *data)
5247{
5248}
5249
5250
5251static void
5252nxt_router_app_prepare_request(nxt_task_t *task,
5253 nxt_request_rpc_data_t *req_rpc_data)
5254{
5255 nxt_app_t *app;
5256 nxt_buf_t *buf, *body;
5257 nxt_int_t res;
5258 nxt_port_t *port, *reply_port;
5259

--- 630 unchanged lines hidden ---
5244nxt_router_app_prepare_request(nxt_task_t *task,
5245 nxt_request_rpc_data_t *req_rpc_data)
5246{
5247 nxt_app_t *app;
5248 nxt_buf_t *buf, *body;
5249 nxt_int_t res;
5250 nxt_port_t *port, *reply_port;
5251

--- 630 unchanged lines hidden ---