comparison src/http/ngx_http_core_module.h @ 378:820f6378fc00 NGINX_0_7_1

nginx 0.7.1 *) Change: now locations are searched in a tree. *) Change: the "optimize_server_names" directive was canceled due to the "server_name_in_redirect" directive introduction. *) Change: some long deprecated directives are not supported anymore. *) Change: the "none" parameter in the "ssl_session_cache" directive; now this is default parameter. Thanks to Rob Mueller. *) Bugfix: worker processes might not catch reconfiguration and log rotation signals. *) Bugfix: nginx could not be built on latest Fedora 9 Linux. Thanks to Roxis.
author Igor Sysoev <http://sysoev.ru>
date Mon, 26 May 2008 00:00:00 +0400
parents 6639b93e81b2
children 0b6053502c55
comparison
equal deleted inserted replaced
377:5d98007adb5f 378:820f6378fc00
26 26
27 #define NGX_HTTP_SATISFY_ALL 0 27 #define NGX_HTTP_SATISFY_ALL 0
28 #define NGX_HTTP_SATISFY_ANY 1 28 #define NGX_HTTP_SATISFY_ANY 1
29 29
30 30
31 typedef struct ngx_http_location_tree_node_s ngx_http_location_tree_node_t;
32 typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t;
33
34
31 typedef struct { 35 typedef struct {
32 unsigned default_server:1; 36 unsigned default_server:1;
33 unsigned bind:1; 37 unsigned bind:1;
34 38
35 int backlog; 39 int backlog;
125 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; 129 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1];
126 } ngx_http_core_main_conf_t; 130 } ngx_http_core_main_conf_t;
127 131
128 132
129 typedef struct { 133 typedef struct {
130 /*
131 * array of the ngx_http_core_loc_conf_t *,
132 * used in the ngx_http_core_find_location() and in the merge phase
133 */
134 ngx_array_t locations;
135
136 unsigned regex_start:15;
137 unsigned named_start:15;
138
139 /* array of the ngx_http_listen_t, "listen" directive */ 134 /* array of the ngx_http_listen_t, "listen" directive */
140 ngx_array_t listen; 135 ngx_array_t listen;
141 136
142 /* array of the ngx_http_server_name_t, "server_name" directive */ 137 /* array of the ngx_http_server_name_t, "server_name" directive */
143 ngx_array_t server_names; 138 ngx_array_t server_names;
144 139
145 /* server ctx */ 140 /* server ctx */
146 ngx_http_conf_ctx_t *ctx; 141 ngx_http_conf_ctx_t *ctx;
147 142
148 ngx_str_t server_name; 143 ngx_str_t server_name;
149 144
150 size_t connection_pool_size; 145 size_t connection_pool_size;
151 size_t request_pool_size; 146 size_t request_pool_size;
152 size_t client_header_buffer_size; 147 size_t client_header_buffer_size;
153 148
154 ngx_bufs_t large_client_header_buffers; 149 ngx_bufs_t large_client_header_buffers;
155 150
156 ngx_msec_t client_header_timeout; 151 ngx_msec_t client_header_timeout;
157 152
158 ngx_flag_t optimize_server_names; 153 ngx_flag_t ignore_invalid_headers;
159 ngx_flag_t ignore_invalid_headers; 154 ngx_flag_t merge_slashes;
160 ngx_flag_t merge_slashes; 155
156 ngx_http_core_loc_conf_t **named_locations;
161 } ngx_http_core_srv_conf_t; 157 } ngx_http_core_srv_conf_t;
162 158
163 159
164 /* list of structures to find core_srv_conf quickly at run time */ 160 /* list of structures to find core_srv_conf quickly at run time */
165 161
229 ngx_array_t *uri_lengths; 225 ngx_array_t *uri_lengths;
230 ngx_array_t *uri_values; 226 ngx_array_t *uri_values;
231 } ngx_http_err_page_t; 227 } ngx_http_err_page_t;
232 228
233 229
234 typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t;
235
236 struct ngx_http_core_loc_conf_s { 230 struct ngx_http_core_loc_conf_s {
237 ngx_str_t name; /* location name */ 231 ngx_str_t name; /* location name */
238 232
239 #if (NGX_PCRE) 233 #if (NGX_PCRE)
240 ngx_regex_t *regex; 234 ngx_regex_t *regex;
241 #endif 235 #endif
242 236
243 unsigned regex_start:15;
244
245 unsigned noname:1; /* "if () {}" block or limit_except */ 237 unsigned noname:1; /* "if () {}" block or limit_except */
246 unsigned named:1; 238 unsigned named:1;
247 239
248 unsigned exact_match:1; 240 unsigned exact_match:1;
249 unsigned noregex:1; 241 unsigned noregex:1;
250 242
251 unsigned auto_redirect:1; 243 unsigned auto_redirect:1;
252 unsigned alias:1; 244 unsigned alias:1;
253 245
254 /* array of inclusive ngx_http_core_loc_conf_t */ 246 ngx_http_location_tree_node_t *static_locations;
255 ngx_array_t *locations; 247 ngx_http_core_loc_conf_t **regex_locations;
256 248
257 /* pointer to the modules' loc_conf */ 249 /* pointer to the modules' loc_conf */
258 void **loc_conf ; 250 void **loc_conf;
259 251
260 uint32_t limit_except; 252 uint32_t limit_except;
261 void **limit_except_loc_conf ; 253 void **limit_except_loc_conf;
262 254
263 ngx_http_handler_pt handler; 255 ngx_http_handler_pt handler;
264 256
265 ngx_str_t root; /* root, alias */ 257 ngx_str_t root; /* root, alias */
266 ngx_str_t post_action; 258 ngx_str_t post_action;
331 ngx_log_t *err_log; 323 ngx_log_t *err_log;
332 324
333 ngx_uint_t types_hash_max_size; 325 ngx_uint_t types_hash_max_size;
334 ngx_uint_t types_hash_bucket_size; 326 ngx_uint_t types_hash_bucket_size;
335 327
328 ngx_queue_t *locations;
329
336 #if 0 330 #if 0
337 ngx_http_core_loc_conf_t *prev_location; 331 ngx_http_core_loc_conf_t *prev_location;
338 #endif 332 #endif
333 };
334
335
336 typedef struct {
337 ngx_queue_t queue;
338 ngx_http_core_loc_conf_t *exact;
339 ngx_http_core_loc_conf_t *inclusive;
340 ngx_str_t *name;
341 u_char *file_name;
342 ngx_uint_t line;
343 ngx_queue_t list;
344 } ngx_http_location_queue_t;
345
346
347 struct ngx_http_location_tree_node_s {
348 ngx_http_location_tree_node_t *left;
349 ngx_http_location_tree_node_t *right;
350 ngx_http_location_tree_node_t *tree;
351
352 ngx_http_core_loc_conf_t *exact;
353 ngx_http_core_loc_conf_t *inclusive;
354
355 u_char auto_redirect;
356 u_char len;
357 u_char name[1];
339 }; 358 };
340 359
341 360
342 void ngx_http_core_run_phases(ngx_http_request_t *r); 361 void ngx_http_core_run_phases(ngx_http_request_t *r);
343 ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r, 362 ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r,
399 \ 418 \
400 #define ngx_http_clear_accept_ranges(r) \ 419 #define ngx_http_clear_accept_ranges(r) \
401 \ 420 \
402 r->allow_ranges = 0; \ 421 r->allow_ranges = 0; \
403 if (r->headers_out.accept_ranges) { \ 422 if (r->headers_out.accept_ranges) { \
404 r->headers_out.accept_ranges->hash = 0 ; \ 423 r->headers_out.accept_ranges->hash = 0; \
405 r->headers_out.accept_ranges = NULL; \ 424 r->headers_out.accept_ranges = NULL; \
406 } 425 }
407 426
408 #define ngx_http_clear_last_modified(r) \ 427 #define ngx_http_clear_last_modified(r) \
409 \ 428 \