Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.h @ 3217:a22bf524a456
refactor http listen code:
*) add listen's to the global cmcf->ports array instead of server's one
*) rename ngx_http_listen_conf_t to ngx_http_listen_opt_t
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 21 Oct 2009 08:19:46 +0000 |
parents | 975f0558aab3 |
children | 022a7662b4ed |
comparison
equal
deleted
inserted
replaced
3216:79ae445ec57b | 3217:a22bf524a456 |
---|---|
63 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) | 63 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) |
64 ngx_uint_t deferred_accept; | 64 ngx_uint_t deferred_accept; |
65 #endif | 65 #endif |
66 | 66 |
67 u_char addr[NGX_SOCKADDR_STRLEN + 1]; | 67 u_char addr[NGX_SOCKADDR_STRLEN + 1]; |
68 } ngx_http_listen_conf_t; | 68 } ngx_http_listen_opt_t; |
69 | 69 |
70 | 70 |
71 typedef struct { | 71 typedef struct { |
72 u_char sockaddr[NGX_SOCKADDRLEN]; | 72 u_char sockaddr[NGX_SOCKADDRLEN]; |
73 socklen_t socklen; | 73 socklen_t socklen; |
74 | 74 |
75 u_char *file_name; | 75 ngx_http_listen_opt_t opt; |
76 ngx_uint_t line; | |
77 | |
78 ngx_http_listen_conf_t conf; | |
79 } ngx_http_listen_t; | 76 } ngx_http_listen_t; |
80 | 77 |
81 | 78 |
82 typedef enum { | 79 typedef enum { |
83 NGX_HTTP_POST_READ_PHASE = 0, | 80 NGX_HTTP_POST_READ_PHASE = 0, |
140 ngx_uint_t variables_hash_max_size; | 137 ngx_uint_t variables_hash_max_size; |
141 ngx_uint_t variables_hash_bucket_size; | 138 ngx_uint_t variables_hash_bucket_size; |
142 | 139 |
143 ngx_hash_keys_arrays_t *variables_keys; | 140 ngx_hash_keys_arrays_t *variables_keys; |
144 | 141 |
142 ngx_array_t *ports; | |
143 | |
145 ngx_uint_t try_files; /* unsigned try_files:1 */ | 144 ngx_uint_t try_files; /* unsigned try_files:1 */ |
146 | 145 |
147 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; | 146 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; |
148 } ngx_http_core_main_conf_t; | 147 } ngx_http_core_main_conf_t; |
149 | 148 |
150 | 149 |
151 typedef struct { | 150 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 */ | 151 /* array of the ngx_http_server_name_t, "server_name" directive */ |
156 ngx_array_t server_names; | 152 ngx_array_t server_names; |
157 | 153 |
158 /* server ctx */ | 154 /* server ctx */ |
159 ngx_http_conf_ctx_t *ctx; | 155 ngx_http_conf_ctx_t *ctx; |
169 ngx_msec_t client_header_timeout; | 165 ngx_msec_t client_header_timeout; |
170 | 166 |
171 ngx_flag_t ignore_invalid_headers; | 167 ngx_flag_t ignore_invalid_headers; |
172 ngx_flag_t merge_slashes; | 168 ngx_flag_t merge_slashes; |
173 ngx_flag_t underscores_in_headers; | 169 ngx_flag_t underscores_in_headers; |
170 | |
171 ngx_uint_t listen; /* unsigned listen:1; */ | |
174 | 172 |
175 ngx_http_core_loc_conf_t **named_locations; | 173 ngx_http_core_loc_conf_t **named_locations; |
176 } ngx_http_core_srv_conf_t; | 174 } ngx_http_core_srv_conf_t; |
177 | 175 |
178 | 176 |
220 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */ | 218 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */ |
221 } ngx_http_conf_port_t; | 219 } ngx_http_conf_port_t; |
222 | 220 |
223 | 221 |
224 typedef struct { | 222 typedef struct { |
225 struct sockaddr *sockaddr; | 223 u_char sockaddr[NGX_SOCKADDRLEN]; |
226 socklen_t socklen; | 224 socklen_t socklen; |
227 | 225 |
228 ngx_hash_t hash; | 226 ngx_hash_t hash; |
229 ngx_hash_wildcard_t *wc_head; | 227 ngx_hash_wildcard_t *wc_head; |
230 ngx_hash_wildcard_t *wc_tail; | 228 ngx_hash_wildcard_t *wc_tail; |
244 unsigned wildcard:1; | 242 unsigned wildcard:1; |
245 #if (NGX_HTTP_SSL) | 243 #if (NGX_HTTP_SSL) |
246 unsigned ssl:1; | 244 unsigned ssl:1; |
247 #endif | 245 #endif |
248 | 246 |
249 ngx_http_listen_conf_t *listen_conf; | 247 ngx_http_listen_opt_t opt; |
250 } ngx_http_conf_addr_t; | 248 } ngx_http_conf_addr_t; |
251 | 249 |
252 | 250 |
253 struct ngx_http_server_name_s { | 251 struct ngx_http_server_name_s { |
254 #if (NGX_PCRE) | 252 #if (NGX_PCRE) |