comparison src/http/ngx_http_core_module.h @ 538:1dcf6adad484 NGINX_0_8_21

nginx 0.8.21 *) Feature: now the "-V" switch shows TLS SNI support. *) Feature: the "listen" directive of the HTTP module supports unix domain sockets. Thanks to Hongli Lai. *) Feature: the "default_server" parameter of the "listen" directive. *) Feature: now a "default" parameter is not required to set listen socket options. *) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms; *) Bugfix: socket leak; the bug had appeared in 0.8.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 26 Oct 2009 00:00:00 +0300
parents f7ec98e3caeb
children e19e5f542878
comparison
equal deleted inserted replaced
537:3ca2e495d9de 538:1dcf6adad484
41 typedef struct ngx_http_location_tree_node_s ngx_http_location_tree_node_t; 41 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; 42 typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t;
43 43
44 44
45 typedef struct { 45 typedef struct {
46 u_char sockaddr[NGX_SOCKADDRLEN];
47 socklen_t socklen;
48
49 unsigned set:1;
46 unsigned default_server:1; 50 unsigned default_server:1;
47 unsigned bind:1; 51 unsigned bind:1;
48 unsigned wildcard:1; 52 unsigned wildcard:1;
49 #if (NGX_HTTP_SSL) 53 #if (NGX_HTTP_SSL)
50 unsigned ssl:1; 54 unsigned ssl:1;
63 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) 67 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
64 ngx_uint_t deferred_accept; 68 ngx_uint_t deferred_accept;
65 #endif 69 #endif
66 70
67 u_char addr[NGX_SOCKADDR_STRLEN + 1]; 71 u_char addr[NGX_SOCKADDR_STRLEN + 1];
68 } ngx_http_listen_conf_t; 72 } 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 73
81 74
82 typedef enum { 75 typedef enum {
83 NGX_HTTP_POST_READ_PHASE = 0, 76 NGX_HTTP_POST_READ_PHASE = 0,
84 77
140 ngx_uint_t variables_hash_max_size; 133 ngx_uint_t variables_hash_max_size;
141 ngx_uint_t variables_hash_bucket_size; 134 ngx_uint_t variables_hash_bucket_size;
142 135
143 ngx_hash_keys_arrays_t *variables_keys; 136 ngx_hash_keys_arrays_t *variables_keys;
144 137
138 ngx_array_t *ports;
139
145 ngx_uint_t try_files; /* unsigned try_files:1 */ 140 ngx_uint_t try_files; /* unsigned try_files:1 */
146 141
147 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; 142 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1];
148 } ngx_http_core_main_conf_t; 143 } ngx_http_core_main_conf_t;
149 144
150 145
151 typedef struct { 146 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 */ 147 /* array of the ngx_http_server_name_t, "server_name" directive */
156 ngx_array_t server_names; 148 ngx_array_t server_names;
157 149
158 /* server ctx */ 150 /* server ctx */
159 ngx_http_conf_ctx_t *ctx; 151 ngx_http_conf_ctx_t *ctx;
170 162
171 ngx_flag_t ignore_invalid_headers; 163 ngx_flag_t ignore_invalid_headers;
172 ngx_flag_t merge_slashes; 164 ngx_flag_t merge_slashes;
173 ngx_flag_t underscores_in_headers; 165 ngx_flag_t underscores_in_headers;
174 166
167 unsigned listen:1;
168 #if (NGX_PCRE)
169 unsigned captures:1;
170 #endif
171
175 ngx_http_core_loc_conf_t **named_locations; 172 ngx_http_core_loc_conf_t **named_locations;
176 } ngx_http_core_srv_conf_t; 173 } ngx_http_core_srv_conf_t;
177 174
178 175
179 /* list of structures to find core_srv_conf quickly at run time */ 176 /* list of structures to find core_srv_conf quickly at run time */
180 177
181 178
182 typedef struct { 179 typedef struct {
183 /* the default server configuration for this address:port */ 180 /* the default server configuration for this address:port */
184 ngx_http_core_srv_conf_t *core_srv_conf; 181 ngx_http_core_srv_conf_t *default_server;
185 182
186 ngx_http_virtual_names_t *virtual_names; 183 ngx_http_virtual_names_t *virtual_names;
187 184
188 #if (NGX_HTTP_SSL) 185 #if (NGX_HTTP_SSL)
189 ngx_uint_t ssl; /* unsigned ssl:1; */ 186 ngx_uint_t ssl; /* unsigned ssl:1; */
220 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */ 217 ngx_array_t addrs; /* array of ngx_http_conf_addr_t */
221 } ngx_http_conf_port_t; 218 } ngx_http_conf_port_t;
222 219
223 220
224 typedef struct { 221 typedef struct {
225 struct sockaddr *sockaddr; 222 ngx_http_listen_opt_t opt;
226 socklen_t socklen;
227 223
228 ngx_hash_t hash; 224 ngx_hash_t hash;
229 ngx_hash_wildcard_t *wc_head; 225 ngx_hash_wildcard_t *wc_head;
230 ngx_hash_wildcard_t *wc_tail; 226 ngx_hash_wildcard_t *wc_tail;
231 227
232 ngx_array_t names; /* array of ngx_http_server_name_t */
233
234 #if (NGX_PCRE) 228 #if (NGX_PCRE)
235 ngx_uint_t nregex; 229 ngx_uint_t nregex;
236 ngx_http_server_name_t *regex; 230 ngx_http_server_name_t *regex;
237 #endif 231 #endif
238 232
239 /* the default server configuration for this address:port */ 233 /* the default server configuration for this address:port */
240 ngx_http_core_srv_conf_t *core_srv_conf; 234 ngx_http_core_srv_conf_t *default_server;
241 235 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; 236 } ngx_http_conf_addr_t;
251 237
252 238
253 struct ngx_http_server_name_s { 239 struct ngx_http_server_name_s {
254 #if (NGX_PCRE) 240 #if (NGX_PCRE)
255 ngx_regex_t *regex; 241 ngx_regex_t *regex;
256 ngx_uint_t captures; /* unsigned captures:1; */ 242 #endif
257 #endif 243 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; 244 ngx_str_t name;
260 }; 245 };
261 246
262 247
263 typedef struct { 248 typedef struct {