Mercurial > hg > nginx-quic
annotate src/core/ngx_cycle.h @ 8467:2ab7b55ae4a0
Stream: the "fastopen" parameter of the "listen" directive.
Based on a patch by Anbang Wen.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 20 May 2021 19:59:16 +0300 |
parents | f18db38a9826 |
children |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
7 |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_CYCLE_H_INCLUDED_ |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #define _NGX_CYCLE_H_INCLUDED_ |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_config.h> |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 #include <ngx_core.h> |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
507 | 16 #ifndef NGX_CYCLE_POOL_SIZE |
5124
5482671df278
Use NGX_DEFAULT_POOL_SIZE macro where appropriate.
Ruslan Ermilov <ru@nginx.com>
parents:
4870
diff
changeset
|
17 #define NGX_CYCLE_POOL_SIZE NGX_DEFAULT_POOL_SIZE |
507 | 18 #endif |
19 | |
20 | |
461 | 21 #define NGX_DEBUG_POINTS_STOP 1 |
22 #define NGX_DEBUG_POINTS_ABORT 2 | |
23 | |
24 | |
972 | 25 typedef struct ngx_shm_zone_s ngx_shm_zone_t; |
26 | |
993
1b9a4d92173f
pass the inherited shm_zone data
Igor Sysoev <igor@sysoev.ru>
parents:
972
diff
changeset
|
27 typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone, void *data); |
972 | 28 |
29 struct ngx_shm_zone_s { | |
30 void *data; | |
860
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
611
diff
changeset
|
31 ngx_shm_t shm; |
972 | 32 ngx_shm_zone_init_pt init; |
33 void *tag; | |
7205
fc4d82c13c04
Core: added a stub for additional zone configuration.
Vladimir Homutov <vl@nginx.com>
parents:
7174
diff
changeset
|
34 void *sync; |
6103
79ddb0bdb273
Upstream: the "zone" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
6016
diff
changeset
|
35 ngx_uint_t noreuse; /* unsigned noreuse:1; */ |
972 | 36 }; |
860
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
611
diff
changeset
|
37 |
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
611
diff
changeset
|
38 |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
39 struct ngx_cycle_s { |
473 | 40 void ****conf_ctx; |
41 ngx_pool_t *pool; | |
317
1308b98496a2
nginx-0.0.3-2004-04-15-19:34:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
42 |
473 | 43 ngx_log_t *log; |
2785
d478379e51ac
*) refactor error_log processing: listen socket log might inherit built-in
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
44 ngx_log_t new_log; |
317
1308b98496a2
nginx-0.0.3-2004-04-15-19:34:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
45 |
5240
d8af1005e886
Core: fixed handling of "stderr" in error_log.
Vladimir Homutov <vl@nginx.com>
parents:
5124
diff
changeset
|
46 ngx_uint_t log_use_stderr; /* unsigned log_use_stderr:1; */ |
d8af1005e886
Core: fixed handling of "stderr" in error_log.
Vladimir Homutov <vl@nginx.com>
parents:
5124
diff
changeset
|
47 |
543 | 48 ngx_connection_t **files; |
49 ngx_connection_t *free_connections; | |
50 ngx_uint_t free_connection_n; | |
51 | |
6379
cf5e822cf470
Dynamic modules: changed ngx_modules to cycle->modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6335
diff
changeset
|
52 ngx_module_t **modules; |
6383 | 53 ngx_uint_t modules_n; |
54 ngx_uint_t modules_used; /* unsigned modules_used:1; */ | |
6379
cf5e822cf470
Dynamic modules: changed ngx_modules to cycle->modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6335
diff
changeset
|
55 |
3880
e3cb8e27e413
reuse keepalive connections if there are no free worker connections
Igor Sysoev <igor@sysoev.ru>
parents:
3762
diff
changeset
|
56 ngx_queue_t reusable_connections_queue; |
6873
426828549afc
Improved connection draining with small number of connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6776
diff
changeset
|
57 ngx_uint_t reusable_connections_n; |
8042
b9071b875194
Core: added a warning about reusing connections.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7205
diff
changeset
|
58 time_t connections_reuse_time; |
3880
e3cb8e27e413
reuse keepalive connections if there are no free worker connections
Igor Sysoev <igor@sysoev.ru>
parents:
3762
diff
changeset
|
59 |
473 | 60 ngx_array_t listening; |
4870
8a9b7b4e9f2d
Correct plural form for "path" in the whole source base.
Andrey Belov <defan@nginx.com>
parents:
4549
diff
changeset
|
61 ngx_array_t paths; |
6776
1bf4f21b1b72
Core: show file contents only once while dumping configuration.
Vladimir Homutov <vl@nginx.com>
parents:
6474
diff
changeset
|
62 |
6187
1b7e246e6b38
Core: store and dump processed configuration.
Vladimir Homutov <vl@nginx.com>
parents:
6127
diff
changeset
|
63 ngx_array_t config_dump; |
6776
1bf4f21b1b72
Core: show file contents only once while dumping configuration.
Vladimir Homutov <vl@nginx.com>
parents:
6474
diff
changeset
|
64 ngx_rbtree_t config_dump_rbtree; |
1bf4f21b1b72
Core: show file contents only once while dumping configuration.
Vladimir Homutov <vl@nginx.com>
parents:
6474
diff
changeset
|
65 ngx_rbtree_node_t config_dump_sentinel; |
1bf4f21b1b72
Core: show file contents only once while dumping configuration.
Vladimir Homutov <vl@nginx.com>
parents:
6474
diff
changeset
|
66 |
473 | 67 ngx_list_t open_files; |
860
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
611
diff
changeset
|
68 ngx_list_t shared_memory; |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
69 |
473 | 70 ngx_uint_t connection_n; |
543 | 71 ngx_uint_t files_n; |
72 | |
561 | 73 ngx_connection_t *connections; |
74 ngx_event_t *read_events; | |
75 ngx_event_t *write_events; | |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
76 |
473 | 77 ngx_cycle_t *old_cycle; |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 |
473 | 79 ngx_str_t conf_file; |
2073 | 80 ngx_str_t conf_param; |
2758 | 81 ngx_str_t conf_prefix; |
82 ngx_str_t prefix; | |
8226
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
8042
diff
changeset
|
83 ngx_str_t error_log; |
860
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
611
diff
changeset
|
84 ngx_str_t lock_file; |
2011 | 85 ngx_str_t hostname; |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
86 }; |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
87 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
88 |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
89 typedef struct { |
6474 | 90 ngx_flag_t daemon; |
91 ngx_flag_t master; | |
300
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
92 |
6474 | 93 ngx_msec_t timer_resolution; |
6930
97c99bb43737
Introduced worker_shutdown_timeout.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6873
diff
changeset
|
94 ngx_msec_t shutdown_timeout; |
563 | 95 |
6474 | 96 ngx_int_t worker_processes; |
97 ngx_int_t debug_points; | |
300
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
98 |
6474 | 99 ngx_int_t rlimit_nofile; |
100 off_t rlimit_core; | |
543 | 101 |
6474 | 102 int priority; |
300
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
103 |
6474 | 104 ngx_uint_t cpu_affinity_auto; |
105 ngx_uint_t cpu_affinity_n; | |
106 ngx_cpuset_t *cpu_affinity; | |
577 | 107 |
6474 | 108 char *username; |
109 ngx_uid_t user; | |
110 ngx_gid_t group; | |
473 | 111 |
6474 | 112 ngx_str_t working_directory; |
113 ngx_str_t lock_file; | |
521 | 114 |
6474 | 115 ngx_str_t pid; |
116 ngx_str_t oldpid; | |
376
d0451e402e27
nginx-0.0.7-2004-07-05-10:55:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
117 |
6474 | 118 ngx_array_t env; |
119 char **environment; | |
7174
84e53e4735a4
Retain CAP_NET_RAW capability for transparent proxying.
Roman Arutyunyan <arut@nginx.com>
parents:
6930
diff
changeset
|
120 |
84e53e4735a4
Retain CAP_NET_RAW capability for transparent proxying.
Roman Arutyunyan <arut@nginx.com>
parents:
6930
diff
changeset
|
121 ngx_uint_t transparent; /* unsigned transparent:1; */ |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
122 } ngx_core_conf_t; |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
123 |
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
124 |
611 | 125 #define ngx_is_init_cycle(cycle) (cycle->conf_ctx == NULL) |
605 | 126 |
127 | |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
128 ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle); |
611 | 129 ngx_int_t ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log); |
311
11ff50a35d6d
nginx-0.0.3-2004-04-12-20:38:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
130 void ngx_delete_pidfile(ngx_cycle_t *cycle); |
2738
ae81441e23f4
implement "-s signal" option for Unix
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
131 ngx_int_t ngx_signal_process(ngx_cycle_t *cycle, char *sig); |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
132 void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user); |
1069 | 133 char **ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last); |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
134 ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv); |
6402
7296b38f6416
Core: added support for more than 64 CPUs in worker_cpu_affinity.
Vladimir Homutov <vl@nginx.com>
parents:
6383
diff
changeset
|
135 ngx_cpuset_t *ngx_get_cpu_affinity(ngx_uint_t n); |
972 | 136 ngx_shm_zone_t *ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, |
137 size_t size, void *tag); | |
6930
97c99bb43737
Introduced worker_shutdown_timeout.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6873
diff
changeset
|
138 void ngx_set_shutdown_timer(ngx_cycle_t *cycle); |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
139 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
140 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
141 extern volatile ngx_cycle_t *ngx_cycle; |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
142 extern ngx_array_t ngx_old_cycles; |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
255
diff
changeset
|
143 extern ngx_module_t ngx_core_module; |
318
56496082668b
nginx-0.0.3-2004-04-16-09:14:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
317
diff
changeset
|
144 extern ngx_uint_t ngx_test_config; |
6187
1b7e246e6b38
Core: store and dump processed configuration.
Vladimir Homutov <vl@nginx.com>
parents:
6127
diff
changeset
|
145 extern ngx_uint_t ngx_dump_config; |
3750 | 146 extern ngx_uint_t ngx_quiet_mode; |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
147 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
148 |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
149 #endif /* _NGX_CYCLE_H_INCLUDED_ */ |