Mercurial > hg > nginx-mail
comparison src/http/ngx_http_core_module.h @ 665:0b460e61bdcd default tip
Merge with nginx 1.0.0.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:22:17 +0400 |
parents | 428c6e58046a |
children |
comparison
equal
deleted
inserted
replaced
572:06419a2298a9 | 665:0b460e61bdcd |
---|---|
36 #define NGX_HTTP_IMS_OFF 0 | 36 #define NGX_HTTP_IMS_OFF 0 |
37 #define NGX_HTTP_IMS_EXACT 1 | 37 #define NGX_HTTP_IMS_EXACT 1 |
38 #define NGX_HTTP_IMS_BEFORE 2 | 38 #define NGX_HTTP_IMS_BEFORE 2 |
39 | 39 |
40 | 40 |
41 #define NGX_HTTP_KEEPALIVE_DISABLE_NONE 0x0002 | |
42 #define NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 0x0004 | |
43 #define NGX_HTTP_KEEPALIVE_DISABLE_SAFARI 0x0008 | |
44 | |
45 | |
41 typedef struct ngx_http_location_tree_node_s ngx_http_location_tree_node_t; | 46 typedef struct ngx_http_location_tree_node_s ngx_http_location_tree_node_t; |
42 typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t; | 47 typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t; |
43 | 48 |
44 | 49 |
45 typedef struct { | 50 typedef struct { |
51 union { | |
52 struct sockaddr sockaddr; | |
53 struct sockaddr_in sockaddr_in; | |
54 #if (NGX_HAVE_INET6) | |
55 struct sockaddr_in6 sockaddr_in6; | |
56 #endif | |
57 #if (NGX_HAVE_UNIX_DOMAIN) | |
58 struct sockaddr_un sockaddr_un; | |
59 #endif | |
60 u_char sockaddr_data[NGX_SOCKADDRLEN]; | |
61 } u; | |
62 | |
63 socklen_t socklen; | |
64 | |
65 unsigned set:1; | |
46 unsigned default_server:1; | 66 unsigned default_server:1; |
47 unsigned bind:1; | 67 unsigned bind:1; |
48 unsigned wildcard:1; | 68 unsigned wildcard:1; |
49 #if (NGX_HTTP_SSL) | 69 #if (NGX_HTTP_SSL) |
50 unsigned ssl:1; | 70 unsigned ssl:1; |
54 #endif | 74 #endif |
55 | 75 |
56 int backlog; | 76 int backlog; |
57 int rcvbuf; | 77 int rcvbuf; |
58 int sndbuf; | 78 int sndbuf; |
79 #if (NGX_HAVE_SETFIB) | |
80 int setfib; | |
81 #endif | |
59 | 82 |
60 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) | 83 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) |
61 char *accept_filter; | 84 char *accept_filter; |
62 #endif | 85 #endif |
63 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) | 86 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) |
64 ngx_uint_t deferred_accept; | 87 ngx_uint_t deferred_accept; |
65 #endif | 88 #endif |
66 | 89 |
67 u_char addr[NGX_SOCKADDR_STRLEN + 1]; | 90 u_char addr[NGX_SOCKADDR_STRLEN + 1]; |
68 } ngx_http_listen_conf_t; | 91 } ngx_http_listen_opt_t; |
69 | |
70 | |
71 typedef struct { | |
72 u_char sockaddr[NGX_SOCKADDRLEN]; | |
73 socklen_t socklen; | |
74 | |
75 u_char *file_name; | |
76 ngx_uint_t line; | |
77 | |
78 ngx_http_listen_conf_t conf; | |
79 } ngx_http_listen_t; | |
80 | 92 |
81 | 93 |
82 typedef enum { | 94 typedef enum { |
83 NGX_HTTP_POST_READ_PHASE = 0, | 95 NGX_HTTP_POST_READ_PHASE = 0, |
84 | 96 |
131 ngx_hash_t headers_in_hash; | 143 ngx_hash_t headers_in_hash; |
132 | 144 |
133 ngx_hash_t variables_hash; | 145 ngx_hash_t variables_hash; |
134 | 146 |
135 ngx_array_t variables; /* ngx_http_variable_t */ | 147 ngx_array_t variables; /* ngx_http_variable_t */ |
148 ngx_uint_t ncaptures; | |
136 | 149 |
137 ngx_uint_t server_names_hash_max_size; | 150 ngx_uint_t server_names_hash_max_size; |
138 ngx_uint_t server_names_hash_bucket_size; | 151 ngx_uint_t server_names_hash_bucket_size; |
139 | 152 |
140 ngx_uint_t variables_hash_max_size; | 153 ngx_uint_t variables_hash_max_size; |
141 ngx_uint_t variables_hash_bucket_size; | 154 ngx_uint_t variables_hash_bucket_size; |
142 | 155 |
143 ngx_hash_keys_arrays_t *variables_keys; | 156 ngx_hash_keys_arrays_t *variables_keys; |
144 | 157 |
158 ngx_array_t *ports; | |
159 | |
145 ngx_uint_t try_files; /* unsigned try_files:1 */ | 160 ngx_uint_t try_files; /* unsigned try_files:1 */ |
146 | 161 |
147 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; | 162 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; |
148 } ngx_http_core_main_conf_t; | 163 } ngx_http_core_main_conf_t; |
149 | 164 |
150 | 165 |
151 typedef struct { | 166 typedef struct { |
152 /* array of the ngx_http_listen_t, "listen" directive */ | |
153 ngx_array_t listen; | |
154 | |
155 /* array of the ngx_http_server_name_t, "server_name" directive */ | 167 /* array of the ngx_http_server_name_t, "server_name" directive */ |
156 ngx_array_t server_names; | 168 ngx_array_t server_names; |
157 | 169 |
158 /* server ctx */ | 170 /* server ctx */ |
159 ngx_http_conf_ctx_t *ctx; | 171 ngx_http_conf_ctx_t *ctx; |
170 | 182 |
171 ngx_flag_t ignore_invalid_headers; | 183 ngx_flag_t ignore_invalid_headers; |
172 ngx_flag_t merge_slashes; | 184 ngx_flag_t merge_slashes; |
173 ngx_flag_t underscores_in_headers; | 185 ngx_flag_t underscores_in_headers; |
174 | 186 |
187 unsigned listen:1; | |
188 #if (NGX_PCRE) | |
189 unsigned captures:1; | |
190 #endif | |
191 | |
175 ngx_http_core_loc_conf_t **named_locations; | 192 ngx_http_core_loc_conf_t **named_locations; |
176 } ngx_http_core_srv_conf_t; | 193 } ngx_http_core_srv_conf_t; |
177 | 194 |
178 | 195 |
179 /* list of structures to find core_srv_conf quickly at run time */ | 196 /* list of structures to find core_srv_conf quickly at run time */ |
180 | 197 |
181 | 198 |
182 typedef struct { | 199 typedef struct { |
183 /* the default server configuration for this address:port */ | 200 /* the default server configuration for this address:port */ |
184 ngx_http_core_srv_conf_t *core_srv_conf; | 201 ngx_http_core_srv_conf_t *default_server; |
185 | 202 |
186 ngx_http_virtual_names_t *virtual_names; | 203 ngx_http_virtual_names_t *virtual_names; |
187 | 204 |
188 #if (NGX_HTTP_SSL) | 205 #if (NGX_HTTP_SSL) |
189 ngx_uint_t ssl; /* unsigned ssl:1; */ | 206 ngx_uint_t ssl; /* unsigned ssl:1; */ |
220 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */ | 237 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */ |
221 } ngx_http_conf_port_t; | 238 } ngx_http_conf_port_t; |
222 | 239 |
223 | 240 |
224 typedef struct { | 241 typedef struct { |
225 struct sockaddr *sockaddr; | 242 ngx_http_listen_opt_t opt; |
226 socklen_t socklen; | |
227 | 243 |
228 ngx_hash_t hash; | 244 ngx_hash_t hash; |
229 ngx_hash_wildcard_t *wc_head; | 245 ngx_hash_wildcard_t *wc_head; |
230 ngx_hash_wildcard_t *wc_tail; | 246 ngx_hash_wildcard_t *wc_tail; |
231 | 247 |
232 ngx_array_t names; /* array of ngx_http_server_name_t */ | |
233 | |
234 #if (NGX_PCRE) | 248 #if (NGX_PCRE) |
235 ngx_uint_t nregex; | 249 ngx_uint_t nregex; |
236 ngx_http_server_name_t *regex; | 250 ngx_http_server_name_t *regex; |
237 #endif | 251 #endif |
238 | 252 |
239 /* the default server configuration for this address:port */ | 253 /* the default server configuration for this address:port */ |
240 ngx_http_core_srv_conf_t *core_srv_conf; | 254 ngx_http_core_srv_conf_t *default_server; |
241 | 255 ngx_array_t servers; /* array of ngx_http_core_srv_conf_t */ |
242 unsigned default_server:1; | |
243 unsigned bind:1; | |
244 unsigned wildcard:1; | |
245 #if (NGX_HTTP_SSL) | |
246 unsigned ssl:1; | |
247 #endif | |
248 | |
249 ngx_http_listen_conf_t *listen_conf; | |
250 } ngx_http_conf_addr_t; | 256 } ngx_http_conf_addr_t; |
251 | 257 |
252 | 258 |
253 struct ngx_http_server_name_s { | 259 struct ngx_http_server_name_s { |
254 #if (NGX_PCRE) | 260 #if (NGX_PCRE) |
255 ngx_regex_t *regex; | 261 ngx_http_regex_t *regex; |
256 ngx_uint_t captures; /* unsigned captures:1; */ | 262 #endif |
257 #endif | 263 ngx_http_core_srv_conf_t *server; /* virtual name server conf */ |
258 ngx_http_core_srv_conf_t *core_srv_conf; /* virtual name server conf */ | |
259 ngx_str_t name; | 264 ngx_str_t name; |
260 }; | 265 }; |
261 | 266 |
262 | 267 |
263 typedef struct { | 268 typedef struct { |
280 | 285 |
281 struct ngx_http_core_loc_conf_s { | 286 struct ngx_http_core_loc_conf_s { |
282 ngx_str_t name; /* location name */ | 287 ngx_str_t name; /* location name */ |
283 | 288 |
284 #if (NGX_PCRE) | 289 #if (NGX_PCRE) |
285 ngx_regex_t *regex; | 290 ngx_http_regex_t *regex; |
286 | |
287 unsigned captures:1; | |
288 #endif | 291 #endif |
289 | 292 |
290 unsigned noname:1; /* "if () {}" block or limit_except */ | 293 unsigned noname:1; /* "if () {}" block or limit_except */ |
294 unsigned lmt_excpt:1; | |
291 unsigned named:1; | 295 unsigned named:1; |
292 | 296 |
293 unsigned exact_match:1; | 297 unsigned exact_match:1; |
294 unsigned noregex:1; | 298 unsigned noregex:1; |
295 | 299 |
296 unsigned auto_redirect:1; | 300 unsigned auto_redirect:1; |
297 unsigned alias:1; | |
298 #if (NGX_HTTP_GZIP) | 301 #if (NGX_HTTP_GZIP) |
299 unsigned gzip_disable_msie6:2; | 302 unsigned gzip_disable_msie6:2; |
303 #if (NGX_HTTP_DEGRADATION) | |
304 unsigned gzip_disable_degradation:2; | |
305 #endif | |
300 #endif | 306 #endif |
301 | 307 |
302 ngx_http_location_tree_node_t *static_locations; | 308 ngx_http_location_tree_node_t *static_locations; |
303 #if (NGX_PCRE) | 309 #if (NGX_PCRE) |
304 ngx_http_core_loc_conf_t **regex_locations; | 310 ngx_http_core_loc_conf_t **regex_locations; |
310 uint32_t limit_except; | 316 uint32_t limit_except; |
311 void **limit_except_loc_conf; | 317 void **limit_except_loc_conf; |
312 | 318 |
313 ngx_http_handler_pt handler; | 319 ngx_http_handler_pt handler; |
314 | 320 |
321 /* location name length for inclusive location with inherited alias */ | |
322 size_t alias; | |
315 ngx_str_t root; /* root, alias */ | 323 ngx_str_t root; /* root, alias */ |
316 ngx_str_t post_action; | 324 ngx_str_t post_action; |
317 | 325 |
318 ngx_array_t *root_lengths; | 326 ngx_array_t *root_lengths; |
319 ngx_array_t *root_values; | 327 ngx_array_t *root_values; |
330 size_t send_lowat; /* send_lowat */ | 338 size_t send_lowat; /* send_lowat */ |
331 size_t postpone_output; /* postpone_output */ | 339 size_t postpone_output; /* postpone_output */ |
332 size_t limit_rate; /* limit_rate */ | 340 size_t limit_rate; /* limit_rate */ |
333 size_t limit_rate_after; /* limit_rate_after */ | 341 size_t limit_rate_after; /* limit_rate_after */ |
334 size_t sendfile_max_chunk; /* sendfile_max_chunk */ | 342 size_t sendfile_max_chunk; /* sendfile_max_chunk */ |
343 size_t read_ahead; /* read_ahead */ | |
335 | 344 |
336 ngx_msec_t client_body_timeout; /* client_body_timeout */ | 345 ngx_msec_t client_body_timeout; /* client_body_timeout */ |
337 ngx_msec_t send_timeout; /* send_timeout */ | 346 ngx_msec_t send_timeout; /* send_timeout */ |
338 ngx_msec_t keepalive_timeout; /* keepalive_timeout */ | 347 ngx_msec_t keepalive_timeout; /* keepalive_timeout */ |
339 ngx_msec_t lingering_time; /* lingering_time */ | 348 ngx_msec_t lingering_time; /* lingering_time */ |
343 ngx_resolver_t *resolver; /* resolver */ | 352 ngx_resolver_t *resolver; /* resolver */ |
344 | 353 |
345 time_t keepalive_header; /* keepalive_timeout */ | 354 time_t keepalive_header; /* keepalive_timeout */ |
346 | 355 |
347 ngx_uint_t keepalive_requests; /* keepalive_requests */ | 356 ngx_uint_t keepalive_requests; /* keepalive_requests */ |
357 ngx_uint_t keepalive_disable; /* keepalive_disable */ | |
348 ngx_uint_t satisfy; /* satisfy */ | 358 ngx_uint_t satisfy; /* satisfy */ |
349 ngx_uint_t if_modified_since; /* if_modified_since */ | 359 ngx_uint_t if_modified_since; /* if_modified_since */ |
350 ngx_uint_t client_body_in_file_only; /* client_body_in_file_only */ | 360 ngx_uint_t client_body_in_file_only; /* client_body_in_file_only */ |
351 | 361 |
352 ngx_flag_t client_body_in_single_buffer; | 362 ngx_flag_t client_body_in_single_buffer; |
365 ngx_flag_t msie_refresh; /* msie_refresh */ | 375 ngx_flag_t msie_refresh; /* msie_refresh */ |
366 ngx_flag_t log_not_found; /* log_not_found */ | 376 ngx_flag_t log_not_found; /* log_not_found */ |
367 ngx_flag_t log_subrequest; /* log_subrequest */ | 377 ngx_flag_t log_subrequest; /* log_subrequest */ |
368 ngx_flag_t recursive_error_pages; /* recursive_error_pages */ | 378 ngx_flag_t recursive_error_pages; /* recursive_error_pages */ |
369 ngx_flag_t server_tokens; /* server_tokens */ | 379 ngx_flag_t server_tokens; /* server_tokens */ |
380 ngx_flag_t chunked_transfer_encoding; /* chunked_transfer_encoding */ | |
370 | 381 |
371 #if (NGX_HTTP_GZIP) | 382 #if (NGX_HTTP_GZIP) |
372 ngx_flag_t gzip_vary; /* gzip_vary */ | 383 ngx_flag_t gzip_vary; /* gzip_vary */ |
373 | 384 |
374 ngx_uint_t gzip_http_version; /* gzip_http_version */ | 385 ngx_uint_t gzip_http_version; /* gzip_http_version */ |
429 | 440 |
430 | 441 |
431 void ngx_http_core_run_phases(ngx_http_request_t *r); | 442 void ngx_http_core_run_phases(ngx_http_request_t *r); |
432 ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r, | 443 ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r, |
433 ngx_http_phase_handler_t *ph); | 444 ngx_http_phase_handler_t *ph); |
445 ngx_int_t ngx_http_core_rewrite_phase(ngx_http_request_t *r, | |
446 ngx_http_phase_handler_t *ph); | |
434 ngx_int_t ngx_http_core_find_config_phase(ngx_http_request_t *r, | 447 ngx_int_t ngx_http_core_find_config_phase(ngx_http_request_t *r, |
435 ngx_http_phase_handler_t *ph); | 448 ngx_http_phase_handler_t *ph); |
436 ngx_int_t ngx_http_core_post_rewrite_phase(ngx_http_request_t *r, | 449 ngx_int_t ngx_http_core_post_rewrite_phase(ngx_http_request_t *r, |
437 ngx_http_phase_handler_t *ph); | 450 ngx_http_phase_handler_t *ph); |
438 ngx_int_t ngx_http_core_access_phase(ngx_http_request_t *r, | 451 ngx_int_t ngx_http_core_access_phase(ngx_http_request_t *r, |
446 | 459 |
447 | 460 |
448 void *ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash); | 461 void *ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash); |
449 ngx_int_t ngx_http_set_content_type(ngx_http_request_t *r); | 462 ngx_int_t ngx_http_set_content_type(ngx_http_request_t *r); |
450 void ngx_http_set_exten(ngx_http_request_t *r); | 463 void ngx_http_set_exten(ngx_http_request_t *r); |
464 ngx_int_t ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status, | |
465 ngx_str_t *ct, ngx_http_complex_value_t *cv); | |
451 u_char *ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *name, | 466 u_char *ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *name, |
452 size_t *root_length, size_t reserved); | 467 size_t *root_length, size_t reserved); |
453 ngx_int_t ngx_http_auth_basic_user(ngx_http_request_t *r); | 468 ngx_int_t ngx_http_auth_basic_user(ngx_http_request_t *r); |
454 #if (NGX_HTTP_GZIP) | 469 #if (NGX_HTTP_GZIP) |
455 ngx_int_t ngx_http_gzip_ok(ngx_http_request_t *r); | 470 ngx_int_t ngx_http_gzip_ok(ngx_http_request_t *r); |