nxt_router.c (616:d7305db3b213) nxt_router.c (630:a7f8c9b7a6af)
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>

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

203 void *data);
204static void nxt_router_thread_exit_handler(nxt_task_t *task, void *obj,
205 void *data);
206static void nxt_router_listen_socket_release(nxt_task_t *task,
207 nxt_socket_conf_t *skcf);
208static void nxt_router_conf_release(nxt_task_t *task,
209 nxt_socket_conf_joint_t *joint);
210
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>

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

203 void *data);
204static void nxt_router_thread_exit_handler(nxt_task_t *task, void *obj,
205 void *data);
206static void nxt_router_listen_socket_release(nxt_task_t *task,
207 nxt_socket_conf_t *skcf);
208static void nxt_router_conf_release(nxt_task_t *task,
209 nxt_socket_conf_joint_t *joint);
210
211static void nxt_router_access_log_writer(nxt_task_t *task,
212 nxt_http_request_t *r, nxt_router_access_log_t *access_log);
213static u_char *nxt_router_access_log_date(u_char *buf, nxt_realtime_t *now,
214 struct tm *tm, size_t size, const char *format);
215static void nxt_router_access_log_open(nxt_task_t *task,
216 nxt_router_temp_conf_t *tmcf);
217static void nxt_router_access_log_ready(nxt_task_t *task,
218 nxt_port_recv_msg_t *msg, void *data);
219static void nxt_router_access_log_error(nxt_task_t *task,
220 nxt_port_recv_msg_t *msg, void *data);
221static void nxt_router_access_log_release(nxt_task_t *task,
222 nxt_thread_spinlock_t *lock, nxt_router_access_log_t *access_log);
223
211static void nxt_router_app_port_ready(nxt_task_t *task,
212 nxt_port_recv_msg_t *msg, void *data);
213static void nxt_router_app_port_error(nxt_task_t *task,
214 nxt_port_recv_msg_t *msg, void *data);
215
216static void nxt_router_app_quit(nxt_task_t *task, nxt_app_t *app);
217static void nxt_router_app_port_release(nxt_task_t *task, nxt_port_t *port,
218 uint32_t request_failed, uint32_t got_response);

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

899nxt_router_conf_apply(nxt_task_t *task, void *obj, void *data)
900{
901 nxt_int_t ret;
902 nxt_app_t *app;
903 nxt_router_t *router;
904 nxt_runtime_t *rt;
905 nxt_queue_link_t *qlk;
906 nxt_socket_conf_t *skcf;
224static void nxt_router_app_port_ready(nxt_task_t *task,
225 nxt_port_recv_msg_t *msg, void *data);
226static void nxt_router_app_port_error(nxt_task_t *task,
227 nxt_port_recv_msg_t *msg, void *data);
228
229static void nxt_router_app_quit(nxt_task_t *task, nxt_app_t *app);
230static void nxt_router_app_port_release(nxt_task_t *task, nxt_port_t *port,
231 uint32_t request_failed, uint32_t got_response);

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

912nxt_router_conf_apply(nxt_task_t *task, void *obj, void *data)
913{
914 nxt_int_t ret;
915 nxt_app_t *app;
916 nxt_router_t *router;
917 nxt_runtime_t *rt;
918 nxt_queue_link_t *qlk;
919 nxt_socket_conf_t *skcf;
920 nxt_router_conf_t *rtcf;
907 nxt_router_temp_conf_t *tmcf;
908 const nxt_event_interface_t *interface;
909
910 tmcf = obj;
911
912 qlk = nxt_queue_first(&tmcf->pending);
913
914 if (qlk != nxt_queue_tail(&tmcf->pending)) {

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

926
927 if (nxt_router_app_need_start(app)) {
928 nxt_router_app_rpc_create(task, tmcf, app);
929 return;
930 }
931
932 } nxt_queue_loop;
933
921 nxt_router_temp_conf_t *tmcf;
922 const nxt_event_interface_t *interface;
923
924 tmcf = obj;
925
926 qlk = nxt_queue_first(&tmcf->pending);
927
928 if (qlk != nxt_queue_tail(&tmcf->pending)) {

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

940
941 if (nxt_router_app_need_start(app)) {
942 nxt_router_app_rpc_create(task, tmcf, app);
943 return;
944 }
945
946 } nxt_queue_loop;
947
948 rtcf = tmcf->router_conf;
949
950 if (rtcf->access_log != NULL && rtcf->access_log->fd == -1) {
951 nxt_router_access_log_open(task, tmcf);
952 return;
953 }
954
934 rt = task->thread->runtime;
935
936 interface = nxt_service_get(rt->services, "engine", NULL);
937
955 rt = task->thread->runtime;
956
957 interface = nxt_service_get(rt->services, "engine", NULL);
958
938 router = tmcf->router_conf->router;
959 router = rtcf->router;
939
940 ret = nxt_router_engines_create(task, router, tmcf, interface);
941 if (nxt_slow_path(ret != NXT_OK)) {
942 goto fail;
943 }
944
945 ret = nxt_router_threads_create(task, rt, tmcf);
946 if (nxt_slow_path(ret != NXT_OK)) {
947 goto fail;
948 }
949
950 nxt_router_apps_sort(task, router, tmcf);
951
952 nxt_router_engines_post(router, tmcf);
953
954 nxt_queue_add(&router->sockets, &tmcf->updating);
955 nxt_queue_add(&router->sockets, &tmcf->creating);
956
960
961 ret = nxt_router_engines_create(task, router, tmcf, interface);
962 if (nxt_slow_path(ret != NXT_OK)) {
963 goto fail;
964 }
965
966 ret = nxt_router_threads_create(task, rt, tmcf);
967 if (nxt_slow_path(ret != NXT_OK)) {
968 goto fail;
969 }
970
971 nxt_router_apps_sort(task, router, tmcf);
972
973 nxt_router_engines_post(router, tmcf);
974
975 nxt_queue_add(&router->sockets, &tmcf->updating);
976 nxt_queue_add(&router->sockets, &tmcf->creating);
977
978 router->access_log = rtcf->access_log;
979
957 nxt_router_conf_ready(task, tmcf);
958
959 return;
960
961fail:
962
963 nxt_router_conf_error(task, tmcf);
964

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

992nxt_router_conf_error(nxt_task_t *task, nxt_router_temp_conf_t *tmcf)
993{
994 nxt_app_t *app;
995 nxt_queue_t new_socket_confs;
996 nxt_socket_t s;
997 nxt_router_t *router;
998 nxt_queue_link_t *qlk;
999 nxt_socket_conf_t *skcf;
980 nxt_router_conf_ready(task, tmcf);
981
982 return;
983
984fail:
985
986 nxt_router_conf_error(task, tmcf);
987

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

1015nxt_router_conf_error(nxt_task_t *task, nxt_router_temp_conf_t *tmcf)
1016{
1017 nxt_app_t *app;
1018 nxt_queue_t new_socket_confs;
1019 nxt_socket_t s;
1020 nxt_router_t *router;
1021 nxt_queue_link_t *qlk;
1022 nxt_socket_conf_t *skcf;
1023 nxt_router_conf_t *rtcf;
1000
1001 nxt_alert(task, "failed to apply new conf");
1002
1003 for (qlk = nxt_queue_first(&tmcf->creating);
1004 qlk != nxt_queue_tail(&tmcf->creating);
1005 qlk = nxt_queue_next(qlk))
1006 {
1007 skcf = nxt_queue_link_data(qlk, nxt_socket_conf_t, link);

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

1029 } nxt_queue_loop;
1030
1031 nxt_queue_each(app, &tmcf->apps, nxt_app_t, link) {
1032
1033 nxt_router_app_quit(task, app);
1034
1035 } nxt_queue_loop;
1036
1024
1025 nxt_alert(task, "failed to apply new conf");
1026
1027 for (qlk = nxt_queue_first(&tmcf->creating);
1028 qlk != nxt_queue_tail(&tmcf->creating);
1029 qlk = nxt_queue_next(qlk))
1030 {
1031 skcf = nxt_queue_link_data(qlk, nxt_socket_conf_t, link);

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

1053 } nxt_queue_loop;
1054
1055 nxt_queue_each(app, &tmcf->apps, nxt_app_t, link) {
1056
1057 nxt_router_app_quit(task, app);
1058
1059 } nxt_queue_loop;
1060
1037 router = tmcf->router_conf->router;
1061 rtcf = tmcf->router_conf;
1062 router = rtcf->router;
1038
1039 nxt_queue_add(&router->sockets, &tmcf->keeping);
1040 nxt_queue_add(&router->sockets, &tmcf->deleting);
1041
1042 nxt_queue_add(&router->apps, &tmcf->previous);
1043
1044 // TODO: new engines and threads
1045
1063
1064 nxt_queue_add(&router->sockets, &tmcf->keeping);
1065 nxt_queue_add(&router->sockets, &tmcf->deleting);
1066
1067 nxt_queue_add(&router->apps, &tmcf->previous);
1068
1069 // TODO: new engines and threads
1070
1046 nxt_mp_destroy(tmcf->router_conf->mem_pool);
1071 nxt_router_access_log_release(task, &router->lock, rtcf->access_log);
1047
1072
1073 nxt_mp_destroy(rtcf->mem_pool);
1074
1048 nxt_router_conf_send(task, tmcf, NXT_PORT_MSG_RPC_ERROR);
1049}
1050
1051
1052static void
1053nxt_router_conf_send(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
1054 nxt_port_msg_type_t type)
1055{

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

1205nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
1206 u_char *start, u_char *end)
1207{
1208 u_char *p;
1209 size_t size;
1210 nxt_mp_t *mp;
1211 uint32_t next;
1212 nxt_int_t ret;
1075 nxt_router_conf_send(task, tmcf, NXT_PORT_MSG_RPC_ERROR);
1076}
1077
1078
1079static void
1080nxt_router_conf_send(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
1081 nxt_port_msg_type_t type)
1082{

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

1232nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
1233 u_char *start, u_char *end)
1234{
1235 u_char *p;
1236 size_t size;
1237 nxt_mp_t *mp;
1238 uint32_t next;
1239 nxt_int_t ret;
1213 nxt_str_t name;
1240 nxt_str_t name, path;
1214 nxt_app_t *app, *prev;
1215 nxt_router_t *router;
1241 nxt_app_t *app, *prev;
1242 nxt_router_t *router;
1216 nxt_conf_value_t *conf, *http;
1243 nxt_conf_value_t *conf, *http, *value;
1217 nxt_conf_value_t *applications, *application;
1218 nxt_conf_value_t *listeners, *listener;
1219 nxt_socket_conf_t *skcf;
1220 nxt_event_engine_t *engine;
1221 nxt_app_lang_module_t *lang;
1222 nxt_router_app_conf_t apcf;
1244 nxt_conf_value_t *applications, *application;
1245 nxt_conf_value_t *listeners, *listener;
1246 nxt_socket_conf_t *skcf;
1247 nxt_event_engine_t *engine;
1248 nxt_app_lang_module_t *lang;
1249 nxt_router_app_conf_t apcf;
1250 nxt_router_access_log_t *access_log;
1223 nxt_router_listener_conf_t lscf;
1224
1225 static nxt_str_t http_path = nxt_string("/http");
1226 static nxt_str_t applications_path = nxt_string("/applications");
1227 static nxt_str_t listeners_path = nxt_string("/listeners");
1251 nxt_router_listener_conf_t lscf;
1252
1253 static nxt_str_t http_path = nxt_string("/http");
1254 static nxt_str_t applications_path = nxt_string("/applications");
1255 static nxt_str_t listeners_path = nxt_string("/listeners");
1256 static nxt_str_t access_log_path = nxt_string("/access_log");
1228
1229 conf = nxt_conf_json_parse(tmcf->mem_pool, start, end, NULL);
1230 if (conf == NULL) {
1231 nxt_alert(task, "configuration parsing error");
1232 return NXT_ERROR;
1233 }
1234
1235 mp = tmcf->router_conf->mem_pool;

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

1463 skcf->listen->handler = nxt_http_conn_init;
1464 skcf->router_conf = tmcf->router_conf;
1465 skcf->router_conf->count++;
1466 skcf->application = nxt_router_listener_application(tmcf,
1467 &lscf.application);
1468 nxt_router_app_use(task, skcf->application, 1);
1469 }
1470
1257
1258 conf = nxt_conf_json_parse(tmcf->mem_pool, start, end, NULL);
1259 if (conf == NULL) {
1260 nxt_alert(task, "configuration parsing error");
1261 return NXT_ERROR;
1262 }
1263
1264 mp = tmcf->router_conf->mem_pool;

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

1492 skcf->listen->handler = nxt_http_conn_init;
1493 skcf->router_conf = tmcf->router_conf;
1494 skcf->router_conf->count++;
1495 skcf->application = nxt_router_listener_application(tmcf,
1496 &lscf.application);
1497 nxt_router_app_use(task, skcf->application, 1);
1498 }
1499
1500 value = nxt_conf_get_path(conf, &access_log_path);
1501
1502 if (value != NULL) {
1503 nxt_conf_get_string(value, &path);
1504
1505 access_log = router->access_log;
1506
1507 if (access_log != NULL && nxt_strstr_eq(&path, &access_log->path)) {
1508 nxt_thread_spin_lock(&router->lock);
1509 access_log->count++;
1510 nxt_thread_spin_unlock(&router->lock);
1511
1512 } else {
1513 access_log = nxt_malloc(sizeof(nxt_router_access_log_t)
1514 + path.length);
1515 if (access_log == NULL) {
1516 nxt_alert(task, "failed to allocate access log structure");
1517 goto fail;
1518 }
1519
1520 access_log->fd = -1;
1521 access_log->handler = &nxt_router_access_log_writer;
1522 access_log->count = 1;
1523
1524 access_log->path.length = path.length;
1525 access_log->path.start = (u_char *) access_log
1526 + sizeof(nxt_router_access_log_t);
1527
1528 nxt_memcpy(access_log->path.start, path.start, path.length);
1529 }
1530
1531 tmcf->router_conf->access_log = access_log;
1532 }
1533
1471 nxt_queue_add(&tmcf->deleting, &router->sockets);
1472 nxt_queue_init(&router->sockets);
1473
1474 return NXT_OK;
1475
1476app_fail:
1477
1478 nxt_free(app);

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

2584 }
2585
2586 /* TODO remove engine->port */
2587 /* TODO excude from connected ports */
2588
2589 if (rtcf != NULL) {
2590 nxt_debug(task, "old router conf is destroyed");
2591
1534 nxt_queue_add(&tmcf->deleting, &router->sockets);
1535 nxt_queue_init(&router->sockets);
1536
1537 return NXT_OK;
1538
1539app_fail:
1540
1541 nxt_free(app);

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

2647 }
2648
2649 /* TODO remove engine->port */
2650 /* TODO excude from connected ports */
2651
2652 if (rtcf != NULL) {
2653 nxt_debug(task, "old router conf is destroyed");
2654
2655 nxt_router_access_log_release(task, lock, rtcf->access_log);
2656
2592 nxt_mp_thread_adopt(rtcf->mem_pool);
2593
2594 nxt_mp_destroy(rtcf->mem_pool);
2595 }
2596
2597 if (engine->shutdown && nxt_queue_is_empty(&engine->joints)) {
2598 nxt_thread_exit(task->thread);
2599 }
2600}
2601
2602
2603static void
2657 nxt_mp_thread_adopt(rtcf->mem_pool);
2658
2659 nxt_mp_destroy(rtcf->mem_pool);
2660 }
2661
2662 if (engine->shutdown && nxt_queue_is_empty(&engine->joints)) {
2663 nxt_thread_exit(task->thread);
2664 }
2665}
2666
2667
2668static void
2669nxt_router_access_log_writer(nxt_task_t *task, nxt_http_request_t *r,
2670 nxt_router_access_log_t *access_log)
2671{
2672 size_t size;
2673 u_char *buf, *p;
2674 nxt_off_t bytes;
2675
2676 static nxt_time_string_t date_cache = {
2677 (nxt_atomic_uint_t) -1,
2678 nxt_router_access_log_date,
2679 "%02d/%s/%4d:%02d:%02d:%02d %c%02d%02d",
2680 sizeof("31/Dec/1986:19:40:00 +0300") - 1,
2681 NXT_THREAD_TIME_LOCAL,
2682 NXT_THREAD_TIME_SEC,
2683 };
2684
2685 size = r->remote->address_length
2686 + 6 /* ' - - [' */
2687 + date_cache.size
2688 + 3 /* '] "' */
2689 + r->method->length
2690 + 1 /* space */
2691 + r->target.length
2692 + 1 /* space */
2693 + r->version.length
2694 + 2 /* '" ' */
2695 + 3 /* status */
2696 + 1 /* space */
2697 + NXT_OFF_T_LEN
2698 + 2 /* ' "' */
2699 + (r->referer != NULL ? r->referer->value_length : 1)
2700 + 3 /* '" "' */
2701 + (r->user_agent != NULL ? r->user_agent->value_length : 1)
2702 + 2 /* '"\n' */
2703 ;
2704
2705 buf = nxt_mp_nget(r->mem_pool, size);
2706 if (nxt_slow_path(buf == NULL)) {
2707 return;
2708 }
2709
2710 p = nxt_cpymem(buf, nxt_sockaddr_address(r->remote),
2711 r->remote->address_length);
2712
2713 p = nxt_cpymem(p, " - - [", 6);
2714
2715 p = nxt_thread_time_string(task->thread, &date_cache, p);
2716
2717 p = nxt_cpymem(p, "] \"", 3);
2718
2719 if (r->method->length != 0) {
2720 p = nxt_cpymem(p, r->method->start, r->method->length);
2721
2722 if (r->target.length != 0) {
2723 *p++ = ' ';
2724 p = nxt_cpymem(p, r->target.start, r->target.length);
2725
2726 if (r->version.length != 0) {
2727 *p++ = ' ';
2728 p = nxt_cpymem(p, r->version.start, r->version.length);
2729 }
2730 }
2731
2732 } else {
2733 *p++ = '-';
2734 }
2735
2736 p = nxt_cpymem(p, "\" ", 2);
2737
2738 p = nxt_sprintf(p, p + 3, "%03d", r->status);
2739
2740 *p++ = ' ';
2741
2742 bytes = nxt_http_proto_body_bytes_sent[r->protocol](task, r->proto);
2743
2744 p = nxt_sprintf(p, p + NXT_OFF_T_LEN, "%O", bytes);
2745
2746 p = nxt_cpymem(p, " \"", 2);
2747
2748 if (r->referer != NULL) {
2749 p = nxt_cpymem(p, r->referer->value, r->referer->value_length);
2750
2751 } else {
2752 *p++ = '-';
2753 }
2754
2755 p = nxt_cpymem(p, "\" \"", 3);
2756
2757 if (r->user_agent != NULL) {
2758 p = nxt_cpymem(p, r->user_agent->value, r->user_agent->value_length);
2759
2760 } else {
2761 *p++ = '-';
2762 }
2763
2764 p = nxt_cpymem(p, "\"\n", 2);
2765
2766 nxt_fd_write(access_log->fd, buf, p - buf);
2767}
2768
2769
2770static u_char *
2771nxt_router_access_log_date(u_char *buf, nxt_realtime_t *now, struct tm *tm,
2772 size_t size, const char *format)
2773{
2774 u_char sign;
2775 time_t gmtoff;
2776
2777 static const char *month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
2778 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
2779
2780 gmtoff = nxt_timezone(tm) / 60;
2781
2782 if (gmtoff < 0) {
2783 gmtoff = -gmtoff;
2784 sign = '-';
2785
2786 } else {
2787 sign = '+';
2788 }
2789
2790 return nxt_sprintf(buf, buf + size, format,
2791 tm->tm_mday, month[tm->tm_mon], tm->tm_year + 1900,
2792 tm->tm_hour, tm->tm_min, tm->tm_sec,
2793 sign, gmtoff / 60, gmtoff % 60);
2794}
2795
2796
2797static void
2798nxt_router_access_log_open(nxt_task_t *task, nxt_router_temp_conf_t *tmcf)
2799{
2800 uint32_t stream;
2801 nxt_buf_t *b;
2802 nxt_port_t *main_port, *router_port;
2803 nxt_runtime_t *rt;
2804 nxt_router_access_log_t *access_log;
2805
2806 access_log = tmcf->router_conf->access_log;
2807
2808 b = nxt_buf_mem_alloc(tmcf->mem_pool, access_log->path.length + 1, 0);
2809 if (nxt_slow_path(b == NULL)) {
2810 goto fail;
2811 }
2812
2813 nxt_buf_cpystr(b, &access_log->path);
2814 *b->mem.free++ = '\0';
2815
2816 rt = task->thread->runtime;
2817 main_port = rt->port_by_type[NXT_PROCESS_MAIN];
2818 router_port = rt->port_by_type[NXT_PROCESS_ROUTER];
2819
2820 stream = nxt_port_rpc_register_handler(task, router_port,
2821 nxt_router_access_log_ready,
2822 nxt_router_access_log_error,
2823 -1, tmcf);
2824 if (nxt_slow_path(stream == 0)) {
2825 goto fail;
2826 }
2827
2828 nxt_port_socket_write(task, main_port, NXT_PORT_MSG_ACCESS_LOG, -1,
2829 stream, router_port->id, b);
2830
2831 return;
2832
2833fail:
2834
2835 nxt_router_conf_error(task, tmcf);
2836}
2837
2838
2839static void
2840nxt_router_access_log_ready(nxt_task_t *task, nxt_port_recv_msg_t *msg,
2841 void *data)
2842{
2843 nxt_router_temp_conf_t *tmcf;
2844 nxt_router_access_log_t *access_log;
2845
2846 tmcf = data;
2847
2848 access_log = tmcf->router_conf->access_log;
2849
2850 access_log->fd = msg->fd;
2851
2852 nxt_work_queue_add(&task->thread->engine->fast_work_queue,
2853 nxt_router_conf_apply, task, tmcf, NULL);
2854}
2855
2856
2857static void
2858nxt_router_access_log_error(nxt_task_t *task, nxt_port_recv_msg_t *msg,
2859 void *data)
2860{
2861 nxt_router_temp_conf_t *tmcf;
2862
2863 tmcf = data;
2864
2865 nxt_router_conf_error(task, tmcf);
2866}
2867
2868
2869static void
2870nxt_router_access_log_release(nxt_task_t *task, nxt_thread_spinlock_t *lock,
2871 nxt_router_access_log_t *access_log)
2872{
2873 if (access_log == NULL) {
2874 return;
2875 }
2876
2877 nxt_thread_spin_lock(lock);
2878
2879 if (--access_log->count != 0) {
2880 access_log = NULL;
2881 }
2882
2883 nxt_thread_spin_unlock(lock);
2884
2885 if (access_log != NULL) {
2886
2887 if (access_log->fd != -1) {
2888 nxt_fd_close(access_log->fd);
2889 }
2890
2891 nxt_free(access_log);
2892 }
2893}
2894
2895
2896static void
2604nxt_router_thread_exit_handler(nxt_task_t *task, void *obj, void *data)
2605{
2606 nxt_port_t *port;
2607 nxt_thread_link_t *link;
2608 nxt_event_engine_t *engine;
2609 nxt_thread_handle_t handle;
2610
2611 handle = (nxt_thread_handle_t) obj;

--- 1749 unchanged lines hidden ---
2897nxt_router_thread_exit_handler(nxt_task_t *task, void *obj, void *data)
2898{
2899 nxt_port_t *port;
2900 nxt_thread_link_t *link;
2901 nxt_event_engine_t *engine;
2902 nxt_thread_handle_t handle;
2903
2904 handle = (nxt_thread_handle_t) obj;

--- 1749 unchanged lines hidden ---