0
|
1
|
|
2 /*
|
|
3 * Copyright (C) Igor Sysoev
|
|
4 */
|
|
5
|
|
6
|
|
7 #ifndef _NGX_HTTP_CORE_H_INCLUDED_
|
|
8 #define _NGX_HTTP_CORE_H_INCLUDED_
|
|
9
|
|
10
|
406
|
11 #include <ngx_config.h>
|
|
12 #include <ngx_core.h>
|
0
|
13 #include <ngx_http.h>
|
|
14
|
|
15
|
358
|
16 #define NGX_HTTP_GZIP_PROXIED_OFF 0x0002
|
|
17 #define NGX_HTTP_GZIP_PROXIED_EXPIRED 0x0004
|
|
18 #define NGX_HTTP_GZIP_PROXIED_NO_CACHE 0x0008
|
|
19 #define NGX_HTTP_GZIP_PROXIED_NO_STORE 0x0010
|
|
20 #define NGX_HTTP_GZIP_PROXIED_PRIVATE 0x0020
|
|
21 #define NGX_HTTP_GZIP_PROXIED_NO_LM 0x0040
|
|
22 #define NGX_HTTP_GZIP_PROXIED_NO_ETAG 0x0080
|
|
23 #define NGX_HTTP_GZIP_PROXIED_AUTH 0x0100
|
|
24 #define NGX_HTTP_GZIP_PROXIED_ANY 0x0200
|
|
25
|
|
26
|
520
|
27 #define NGX_HTTP_AIO_OFF 0
|
|
28 #define NGX_HTTP_AIO_ON 1
|
|
29 #define NGX_HTTP_AIO_SENDFILE 2
|
|
30
|
|
31
|
362
|
32 #define NGX_HTTP_SATISFY_ALL 0
|
|
33 #define NGX_HTTP_SATISFY_ANY 1
|
|
34
|
|
35
|
632
|
36 #define NGX_HTTP_LINGERING_OFF 0
|
|
37 #define NGX_HTTP_LINGERING_ON 1
|
|
38 #define NGX_HTTP_LINGERING_ALWAYS 2
|
|
39
|
|
40
|
444
|
41 #define NGX_HTTP_IMS_OFF 0
|
|
42 #define NGX_HTTP_IMS_EXACT 1
|
|
43 #define NGX_HTTP_IMS_BEFORE 2
|
|
44
|
|
45
|
604
|
46 #define NGX_HTTP_KEEPALIVE_DISABLE_NONE 0x0002
|
|
47 #define NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 0x0004
|
|
48 #define NGX_HTTP_KEEPALIVE_DISABLE_SAFARI 0x0008
|
|
49
|
|
50
|
378
|
51 typedef struct ngx_http_location_tree_node_s ngx_http_location_tree_node_t;
|
|
52 typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t;
|
|
53
|
|
54
|
0
|
55 typedef struct {
|
558
|
56 union {
|
|
57 struct sockaddr sockaddr;
|
|
58 struct sockaddr_in sockaddr_in;
|
|
59 #if (NGX_HAVE_INET6)
|
|
60 struct sockaddr_in6 sockaddr_in6;
|
|
61 #endif
|
|
62 #if (NGX_HAVE_UNIX_DOMAIN)
|
|
63 struct sockaddr_un sockaddr_un;
|
|
64 #endif
|
|
65 u_char sockaddr_data[NGX_SOCKADDRLEN];
|
|
66 } u;
|
|
67
|
538
|
68 socklen_t socklen;
|
|
69
|
|
70 unsigned set:1;
|
72
|
71 unsigned default_server:1;
|
|
72 unsigned bind:1;
|
448
|
73 unsigned wildcard:1;
|
404
|
74 #if (NGX_HTTP_SSL)
|
|
75 unsigned ssl:1;
|
|
76 #endif
|
460
|
77 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
|
|
78 unsigned ipv6only:2;
|
|
79 #endif
|
654
|
80 unsigned so_keepalive:2;
|
72
|
81
|
|
82 int backlog;
|
112
|
83 int rcvbuf;
|
|
84 int sndbuf;
|
584
|
85 #if (NGX_HAVE_SETFIB)
|
|
86 int setfib;
|
|
87 #endif
|
654
|
88 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
|
|
89 int tcp_keepidle;
|
|
90 int tcp_keepintvl;
|
|
91 int tcp_keepcnt;
|
|
92 #endif
|
72
|
93
|
|
94 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
|
|
95 char *accept_filter;
|
|
96 #endif
|
|
97 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
|
|
98 ngx_uint_t deferred_accept;
|
|
99 #endif
|
|
100
|
448
|
101 u_char addr[NGX_SOCKADDR_STRLEN + 1];
|
538
|
102 } ngx_http_listen_opt_t;
|
0
|
103
|
|
104
|
|
105 typedef enum {
|
122
|
106 NGX_HTTP_POST_READ_PHASE = 0,
|
0
|
107
|
122
|
108 NGX_HTTP_SERVER_REWRITE_PHASE,
|
230
|
109
|
122
|
110 NGX_HTTP_FIND_CONFIG_PHASE,
|
38
|
111 NGX_HTTP_REWRITE_PHASE,
|
230
|
112 NGX_HTTP_POST_REWRITE_PHASE,
|
0
|
113
|
130
|
114 NGX_HTTP_PREACCESS_PHASE,
|
|
115
|
0
|
116 NGX_HTTP_ACCESS_PHASE,
|
230
|
117 NGX_HTTP_POST_ACCESS_PHASE,
|
|
118
|
430
|
119 NGX_HTTP_TRY_FILES_PHASE,
|
0
|
120 NGX_HTTP_CONTENT_PHASE,
|
|
121
|
130
|
122 NGX_HTTP_LOG_PHASE
|
0
|
123 } ngx_http_phases;
|
|
124
|
230
|
125 typedef struct ngx_http_phase_handler_s ngx_http_phase_handler_t;
|
|
126
|
|
127 typedef ngx_int_t (*ngx_http_phase_handler_pt)(ngx_http_request_t *r,
|
|
128 ngx_http_phase_handler_t *ph);
|
|
129
|
|
130 struct ngx_http_phase_handler_s {
|
|
131 ngx_http_phase_handler_pt checker;
|
|
132 ngx_http_handler_pt handler;
|
|
133 ngx_uint_t next;
|
|
134 };
|
|
135
|
|
136
|
|
137 typedef struct {
|
|
138 ngx_http_phase_handler_t *handlers;
|
|
139 ngx_uint_t server_rewrite_index;
|
324
|
140 ngx_uint_t location_rewrite_index;
|
230
|
141 } ngx_http_phase_engine_t;
|
|
142
|
0
|
143
|
|
144 typedef struct {
|
26
|
145 ngx_array_t handlers;
|
0
|
146 } ngx_http_phase_t;
|
|
147
|
|
148
|
|
149 typedef struct {
|
34
|
150 ngx_array_t servers; /* ngx_http_core_srv_conf_t */
|
26
|
151
|
230
|
152 ngx_http_phase_engine_t phase_engine;
|
0
|
153
|
198
|
154 ngx_hash_t headers_in_hash;
|
160
|
155
|
|
156 ngx_hash_t variables_hash;
|
|
157
|
|
158 ngx_array_t variables; /* ngx_http_variable_t */
|
546
|
159 ngx_uint_t ncaptures;
|
56
|
160
|
142
|
161 ngx_uint_t server_names_hash_max_size;
|
|
162 ngx_uint_t server_names_hash_bucket_size;
|
34
|
163
|
160
|
164 ngx_uint_t variables_hash_max_size;
|
|
165 ngx_uint_t variables_hash_bucket_size;
|
|
166
|
|
167 ngx_hash_keys_arrays_t *variables_keys;
|
230
|
168
|
538
|
169 ngx_array_t *ports;
|
|
170
|
430
|
171 ngx_uint_t try_files; /* unsigned try_files:1 */
|
|
172
|
230
|
173 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1];
|
0
|
174 } ngx_http_core_main_conf_t;
|
|
175
|
|
176
|
|
177 typedef struct {
|
34
|
178 /* array of the ngx_http_server_name_t, "server_name" directive */
|
378
|
179 ngx_array_t server_names;
|
0
|
180
|
|
181 /* server ctx */
|
378
|
182 ngx_http_conf_ctx_t *ctx;
|
0
|
183
|
378
|
184 ngx_str_t server_name;
|
142
|
185
|
378
|
186 size_t connection_pool_size;
|
|
187 size_t request_pool_size;
|
|
188 size_t client_header_buffer_size;
|
0
|
189
|
378
|
190 ngx_bufs_t large_client_header_buffers;
|
0
|
191
|
378
|
192 ngx_msec_t client_header_timeout;
|
0
|
193
|
378
|
194 ngx_flag_t ignore_invalid_headers;
|
|
195 ngx_flag_t merge_slashes;
|
412
|
196 ngx_flag_t underscores_in_headers;
|
378
|
197
|
538
|
198 unsigned listen:1;
|
|
199 #if (NGX_PCRE)
|
|
200 unsigned captures:1;
|
|
201 #endif
|
|
202
|
378
|
203 ngx_http_core_loc_conf_t **named_locations;
|
0
|
204 } ngx_http_core_srv_conf_t;
|
|
205
|
|
206
|
|
207 /* list of structures to find core_srv_conf quickly at run time */
|
|
208
|
142
|
209
|
|
210 typedef struct {
|
|
211 /* the default server configuration for this address:port */
|
538
|
212 ngx_http_core_srv_conf_t *default_server;
|
326
|
213
|
478
|
214 ngx_http_virtual_names_t *virtual_names;
|
|
215
|
404
|
216 #if (NGX_HTTP_SSL)
|
|
217 ngx_uint_t ssl; /* unsigned ssl:1; */
|
|
218 #endif
|
448
|
219 } ngx_http_addr_conf_t;
|
|
220
|
|
221
|
|
222 typedef struct {
|
|
223 in_addr_t addr;
|
|
224 ngx_http_addr_conf_t conf;
|
142
|
225 } ngx_http_in_addr_t;
|
|
226
|
|
227
|
448
|
228 #if (NGX_HAVE_INET6)
|
|
229
|
|
230 typedef struct {
|
|
231 struct in6_addr addr6;
|
|
232 ngx_http_addr_conf_t conf;
|
|
233 } ngx_http_in6_addr_t;
|
|
234
|
|
235 #endif
|
|
236
|
|
237
|
0
|
238 typedef struct {
|
448
|
239 /* ngx_http_in_addr_t or ngx_http_in6_addr_t */
|
|
240 void *addrs;
|
142
|
241 ngx_uint_t naddrs;
|
448
|
242 } ngx_http_port_t;
|
0
|
243
|
|
244
|
142
|
245 typedef struct {
|
448
|
246 ngx_int_t family;
|
142
|
247 in_port_t port;
|
448
|
248 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */
|
|
249 } ngx_http_conf_port_t;
|
142
|
250
|
|
251
|
|
252 typedef struct {
|
538
|
253 ngx_http_listen_opt_t opt;
|
26
|
254
|
142
|
255 ngx_hash_t hash;
|
312
|
256 ngx_hash_wildcard_t *wc_head;
|
|
257 ngx_hash_wildcard_t *wc_tail;
|
142
|
258
|
326
|
259 #if (NGX_PCRE)
|
|
260 ngx_uint_t nregex;
|
|
261 ngx_http_server_name_t *regex;
|
|
262 #endif
|
|
263
|
26
|
264 /* the default server configuration for this address:port */
|
538
|
265 ngx_http_core_srv_conf_t *default_server;
|
|
266 ngx_array_t servers; /* array of ngx_http_core_srv_conf_t */
|
448
|
267 } ngx_http_conf_addr_t;
|
0
|
268
|
|
269
|
326
|
270 struct ngx_http_server_name_s {
|
|
271 #if (NGX_PCRE)
|
546
|
272 ngx_http_regex_t *regex;
|
326
|
273 #endif
|
538
|
274 ngx_http_core_srv_conf_t *server; /* virtual name server conf */
|
0
|
275 ngx_str_t name;
|
326
|
276 };
|
0
|
277
|
|
278
|
|
279 typedef struct {
|
222
|
280 ngx_int_t status;
|
|
281 ngx_int_t overwrite;
|
464
|
282 ngx_http_complex_value_t value;
|
372
|
283 ngx_str_t args;
|
0
|
284 } ngx_http_err_page_t;
|
|
285
|
|
286
|
430
|
287 typedef struct {
|
|
288 ngx_array_t *lengths;
|
|
289 ngx_array_t *values;
|
|
290 ngx_str_t name;
|
478
|
291
|
|
292 unsigned code:10;
|
|
293 unsigned test_dir:1;
|
430
|
294 } ngx_http_try_file_t;
|
|
295
|
|
296
|
0
|
297 struct ngx_http_core_loc_conf_s {
|
|
298 ngx_str_t name; /* location name */
|
|
299
|
4
|
300 #if (NGX_PCRE)
|
546
|
301 ngx_http_regex_t *regex;
|
0
|
302 #endif
|
|
303
|
324
|
304 unsigned noname:1; /* "if () {}" block or limit_except */
|
592
|
305 unsigned lmt_excpt:1;
|
324
|
306 unsigned named:1;
|
34
|
307
|
0
|
308 unsigned exact_match:1;
|
16
|
309 unsigned noregex:1;
|
|
310
|
0
|
311 unsigned auto_redirect:1;
|
400
|
312 #if (NGX_HTTP_GZIP)
|
|
313 unsigned gzip_disable_msie6:2;
|
602
|
314 #if (NGX_HTTP_DEGRADATION)
|
|
315 unsigned gzip_disable_degradation:2;
|
|
316 #endif
|
400
|
317 #endif
|
0
|
318
|
378
|
319 ngx_http_location_tree_node_t *static_locations;
|
456
|
320 #if (NGX_PCRE)
|
378
|
321 ngx_http_core_loc_conf_t **regex_locations;
|
456
|
322 #endif
|
0
|
323
|
|
324 /* pointer to the modules' loc_conf */
|
378
|
325 void **loc_conf;
|
0
|
326
|
180
|
327 uint32_t limit_except;
|
378
|
328 void **limit_except_loc_conf;
|
180
|
329
|
0
|
330 ngx_http_handler_pt handler;
|
|
331
|
574
|
332 /* location name length for inclusive location with inherited alias */
|
|
333 size_t alias;
|
126
|
334 ngx_str_t root; /* root, alias */
|
|
335 ngx_str_t post_action;
|
|
336
|
144
|
337 ngx_array_t *root_lengths;
|
|
338 ngx_array_t *root_values;
|
|
339
|
138
|
340 ngx_array_t *types;
|
|
341 ngx_hash_t types_hash;
|
|
342 ngx_str_t default_type;
|
|
343
|
212
|
344 off_t client_max_body_size; /* client_max_body_size */
|
390
|
345 off_t directio; /* directio */
|
518
|
346 off_t directio_alignment; /* directio_alignment */
|
212
|
347
|
0
|
348 size_t client_body_buffer_size; /* client_body_buffer_size */
|
|
349 size_t send_lowat; /* send_lowat */
|
|
350 size_t postpone_output; /* postpone_output */
|
|
351 size_t limit_rate; /* limit_rate */
|
496
|
352 size_t limit_rate_after; /* limit_rate_after */
|
300
|
353 size_t sendfile_max_chunk; /* sendfile_max_chunk */
|
532
|
354 size_t read_ahead; /* read_ahead */
|
0
|
355
|
|
356 ngx_msec_t client_body_timeout; /* client_body_timeout */
|
|
357 ngx_msec_t send_timeout; /* send_timeout */
|
|
358 ngx_msec_t keepalive_timeout; /* keepalive_timeout */
|
|
359 ngx_msec_t lingering_time; /* lingering_time */
|
|
360 ngx_msec_t lingering_timeout; /* lingering_timeout */
|
348
|
361 ngx_msec_t resolver_timeout; /* resolver_timeout */
|
|
362
|
|
363 ngx_resolver_t *resolver; /* resolver */
|
0
|
364
|
|
365 time_t keepalive_header; /* keepalive_timeout */
|
|
366
|
496
|
367 ngx_uint_t keepalive_requests; /* keepalive_requests */
|
604
|
368 ngx_uint_t keepalive_disable; /* keepalive_disable */
|
362
|
369 ngx_uint_t satisfy; /* satisfy */
|
632
|
370 ngx_uint_t lingering_close; /* lingering_close */
|
424
|
371 ngx_uint_t if_modified_since; /* if_modified_since */
|
636
|
372 ngx_uint_t max_ranges; /* max_ranges */
|
492
|
373 ngx_uint_t client_body_in_file_only; /* client_body_in_file_only */
|
362
|
374
|
492
|
375 ngx_flag_t client_body_in_single_buffer;
|
|
376 /* client_body_in_singe_buffer */
|
58
|
377 ngx_flag_t internal; /* internal */
|
0
|
378 ngx_flag_t sendfile; /* sendfile */
|
518
|
379 #if (NGX_HAVE_FILE_AIO)
|
|
380 ngx_flag_t aio; /* aio */
|
|
381 #endif
|
0
|
382 ngx_flag_t tcp_nopush; /* tcp_nopush */
|
2
|
383 ngx_flag_t tcp_nodelay; /* tcp_nodelay */
|
0
|
384 ngx_flag_t reset_timedout_connection; /* reset_timedout_connection */
|
362
|
385 ngx_flag_t server_name_in_redirect; /* server_name_in_redirect */
|
70
|
386 ngx_flag_t port_in_redirect; /* port_in_redirect */
|
0
|
387 ngx_flag_t msie_padding; /* msie_padding */
|
228
|
388 ngx_flag_t msie_refresh; /* msie_refresh */
|
76
|
389 ngx_flag_t log_not_found; /* log_not_found */
|
412
|
390 ngx_flag_t log_subrequest; /* log_subrequest */
|
228
|
391 ngx_flag_t recursive_error_pages; /* recursive_error_pages */
|
342
|
392 ngx_flag_t server_tokens; /* server_tokens */
|
566
|
393 ngx_flag_t chunked_transfer_encoding; /* chunked_transfer_encoding */
|
0
|
394
|
358
|
395 #if (NGX_HTTP_GZIP)
|
|
396 ngx_flag_t gzip_vary; /* gzip_vary */
|
|
397
|
|
398 ngx_uint_t gzip_http_version; /* gzip_http_version */
|
|
399 ngx_uint_t gzip_proxied; /* gzip_proxied */
|
|
400
|
|
401 #if (NGX_PCRE)
|
|
402 ngx_array_t *gzip_disable; /* gzip_disable */
|
|
403 #endif
|
|
404 #endif
|
|
405
|
0
|
406 ngx_array_t *error_pages; /* error_page */
|
430
|
407 ngx_http_try_file_t *try_files; /* try_files */
|
0
|
408
|
28
|
409 ngx_path_t *client_body_temp_path; /* client_body_temp_path */
|
|
410
|
332
|
411 ngx_open_file_cache_t *open_file_cache;
|
358
|
412 time_t open_file_cache_valid;
|
|
413 ngx_uint_t open_file_cache_min_uses;
|
332
|
414 ngx_flag_t open_file_cache_errors;
|
|
415 ngx_flag_t open_file_cache_events;
|
0
|
416
|
484
|
417 ngx_log_t *error_log;
|
0
|
418
|
138
|
419 ngx_uint_t types_hash_max_size;
|
|
420 ngx_uint_t types_hash_bucket_size;
|
|
421
|
378
|
422 ngx_queue_t *locations;
|
|
423
|
34
|
424 #if 0
|
0
|
425 ngx_http_core_loc_conf_t *prev_location;
|
34
|
426 #endif
|
0
|
427 };
|
|
428
|
|
429
|
378
|
430 typedef struct {
|
|
431 ngx_queue_t queue;
|
|
432 ngx_http_core_loc_conf_t *exact;
|
|
433 ngx_http_core_loc_conf_t *inclusive;
|
|
434 ngx_str_t *name;
|
|
435 u_char *file_name;
|
|
436 ngx_uint_t line;
|
|
437 ngx_queue_t list;
|
|
438 } ngx_http_location_queue_t;
|
|
439
|
|
440
|
|
441 struct ngx_http_location_tree_node_s {
|
|
442 ngx_http_location_tree_node_t *left;
|
|
443 ngx_http_location_tree_node_t *right;
|
|
444 ngx_http_location_tree_node_t *tree;
|
|
445
|
|
446 ngx_http_core_loc_conf_t *exact;
|
|
447 ngx_http_core_loc_conf_t *inclusive;
|
|
448
|
|
449 u_char auto_redirect;
|
|
450 u_char len;
|
|
451 u_char name[1];
|
|
452 };
|
|
453
|
|
454
|
230
|
455 void ngx_http_core_run_phases(ngx_http_request_t *r);
|
|
456 ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r,
|
|
457 ngx_http_phase_handler_t *ph);
|
580
|
458 ngx_int_t ngx_http_core_rewrite_phase(ngx_http_request_t *r,
|
|
459 ngx_http_phase_handler_t *ph);
|
230
|
460 ngx_int_t ngx_http_core_find_config_phase(ngx_http_request_t *r,
|
|
461 ngx_http_phase_handler_t *ph);
|
|
462 ngx_int_t ngx_http_core_post_rewrite_phase(ngx_http_request_t *r,
|
|
463 ngx_http_phase_handler_t *ph);
|
|
464 ngx_int_t ngx_http_core_access_phase(ngx_http_request_t *r,
|
|
465 ngx_http_phase_handler_t *ph);
|
|
466 ngx_int_t ngx_http_core_post_access_phase(ngx_http_request_t *r,
|
|
467 ngx_http_phase_handler_t *ph);
|
430
|
468 ngx_int_t ngx_http_core_try_files_phase(ngx_http_request_t *r,
|
|
469 ngx_http_phase_handler_t *ph);
|
230
|
470 ngx_int_t ngx_http_core_content_phase(ngx_http_request_t *r,
|
|
471 ngx_http_phase_handler_t *ph);
|
0
|
472
|
392
|
473
|
|
474 void *ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash);
|
0
|
475 ngx_int_t ngx_http_set_content_type(ngx_http_request_t *r);
|
508
|
476 void ngx_http_set_exten(ngx_http_request_t *r);
|
580
|
477 ngx_int_t ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
|
|
478 ngx_str_t *ct, ngx_http_complex_value_t *cv);
|
106
|
479 u_char *ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *name,
|
248
|
480 size_t *root_length, size_t reserved);
|
88
|
481 ngx_int_t ngx_http_auth_basic_user(ngx_http_request_t *r);
|
358
|
482 #if (NGX_HTTP_GZIP)
|
|
483 ngx_int_t ngx_http_gzip_ok(ngx_http_request_t *r);
|
|
484 #endif
|
|
485
|
0
|
486
|
58
|
487 ngx_int_t ngx_http_subrequest(ngx_http_request_t *r,
|
244
|
488 ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **sr,
|
248
|
489 ngx_http_post_subrequest_t *psr, ngx_uint_t flags);
|
0
|
490 ngx_int_t ngx_http_internal_redirect(ngx_http_request_t *r,
|
48
|
491 ngx_str_t *uri, ngx_str_t *args);
|
324
|
492 ngx_int_t ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name);
|
|
493
|
34
|
494
|
118
|
495 ngx_http_cleanup_t *ngx_http_cleanup_add(ngx_http_request_t *r, size_t size);
|
|
496
|
0
|
497
|
|
498 typedef ngx_int_t (*ngx_http_output_header_filter_pt)(ngx_http_request_t *r);
|
|
499 typedef ngx_int_t (*ngx_http_output_body_filter_pt)
|
48
|
500 (ngx_http_request_t *r, ngx_chain_t *chain);
|
0
|
501
|
|
502
|
|
503 ngx_int_t ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *chain);
|
|
504 ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *chain);
|
|
505
|
|
506
|
126
|
507 extern ngx_module_t ngx_http_core_module;
|
|
508
|
|
509 extern ngx_uint_t ngx_http_max_module;
|
|
510
|
480
|
511 extern ngx_str_t ngx_http_core_get_method;
|
|
512
|
126
|
513
|
|
514 #define ngx_http_clear_content_length(r) \
|
|
515 \
|
|
516 r->headers_out.content_length_n = -1; \
|
|
517 if (r->headers_out.content_length) { \
|
|
518 r->headers_out.content_length->hash = 0; \
|
|
519 r->headers_out.content_length = NULL; \
|
|
520 }
|
|
521 \
|
|
522 #define ngx_http_clear_accept_ranges(r) \
|
|
523 \
|
130
|
524 r->allow_ranges = 0; \
|
126
|
525 if (r->headers_out.accept_ranges) { \
|
378
|
526 r->headers_out.accept_ranges->hash = 0; \
|
126
|
527 r->headers_out.accept_ranges = NULL; \
|
|
528 }
|
|
529
|
|
530 #define ngx_http_clear_last_modified(r) \
|
|
531 \
|
|
532 r->headers_out.last_modified_time = -1; \
|
|
533 if (r->headers_out.last_modified) { \
|
|
534 r->headers_out.last_modified->hash = 0; \
|
|
535 r->headers_out.last_modified = NULL; \
|
|
536 }
|
|
537
|
644
|
538 #define ngx_http_clear_location(r) \
|
|
539 \
|
|
540 if (r->headers_out.location) { \
|
|
541 r->headers_out.location->hash = 0; \
|
|
542 r->headers_out.location = NULL; \
|
|
543 }
|
|
544
|
126
|
545
|
0
|
546 #endif /* _NGX_HTTP_CORE_H_INCLUDED_ */
|