Mercurial > hg > nginx-vendor-0-7
comparison src/http/ngx_http_request.h @ 50:72eb30262aac NGINX_0_1_25
nginx 0.1.25
*) Bugfix: nginx did run on Linux parisc.
*) Feature: nginx now does not start under FreeBSD if the sysctl
kern.ipc.somaxconn value is too big.
*) Bugfix: if a request was internally redirected by the
ngx_http_index_module module to the ngx_http_proxy_module or
ngx_http_fastcgi_module modules, then the index file was not closed
after request completion.
*) Feature: the "proxy_pass" can be used in location with regular
expression.
*) Feature: the ngx_http_rewrite_filter_module module supports the
condition like "if ($HTTP_USER_AGENT ~ MSIE)".
*) Bugfix: nginx started too slow if the large number of addresses and
text values were used in the "geo" directive.
*) Change: a variable name must be declared as "$name" in the "geo"
directive. The previous variant without "$" is still supported, but
will be removed soon.
*) Feature: the "%{VARIABLE}v" logging parameter.
*) Feature: the "set $name value" directive.
*) Bugfix: gcc 4.0 compatibility.
*) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Sat, 19 Mar 2005 00:00:00 +0300 |
parents | 9f3205d496a0 |
children | 0d75d65c642f |
comparison
equal
deleted
inserted
replaced
49:93dabbc9efb9 | 50:72eb30262aac |
---|---|
117 NGX_HTTP_KEEPALIVE_STATE | 117 NGX_HTTP_KEEPALIVE_STATE |
118 } ngx_http_state_e; | 118 } ngx_http_state_e; |
119 | 119 |
120 | 120 |
121 typedef struct { | 121 typedef struct { |
122 ngx_str_t name; | 122 ngx_str_t name; |
123 ngx_uint_t offset; | 123 ngx_uint_t offset; |
124 } ngx_http_header_t; | 124 } ngx_http_header_t; |
125 | 125 |
126 | 126 |
127 typedef struct { | 127 typedef struct { |
128 ngx_list_t headers; | 128 ngx_list_t headers; |
129 | 129 |
130 ngx_table_elt_t *host; | 130 ngx_table_elt_t *host; |
131 ngx_table_elt_t *connection; | 131 ngx_table_elt_t *connection; |
132 ngx_table_elt_t *if_modified_since; | 132 ngx_table_elt_t *if_modified_since; |
133 ngx_table_elt_t *user_agent; | 133 ngx_table_elt_t *user_agent; |
134 ngx_table_elt_t *referer; | 134 ngx_table_elt_t *referer; |
135 ngx_table_elt_t *content_length; | 135 ngx_table_elt_t *content_length; |
136 ngx_table_elt_t *content_type; | 136 ngx_table_elt_t *content_type; |
137 | 137 |
138 ngx_table_elt_t *range; | 138 ngx_table_elt_t *range; |
139 | 139 |
140 #if (NGX_HTTP_GZIP) | 140 #if (NGX_HTTP_GZIP) |
141 ngx_table_elt_t *accept_encoding; | 141 ngx_table_elt_t *accept_encoding; |
142 ngx_table_elt_t *via; | 142 ngx_table_elt_t *via; |
143 #endif | 143 #endif |
144 | 144 |
145 ngx_table_elt_t *authorization; | 145 ngx_table_elt_t *authorization; |
146 | 146 |
147 ngx_table_elt_t *keep_alive; | 147 ngx_table_elt_t *keep_alive; |
148 | 148 |
149 #if (NGX_HTTP_PROXY) | 149 #if (NGX_HTTP_PROXY) |
150 ngx_table_elt_t *x_forwarded_for; | 150 ngx_table_elt_t *x_forwarded_for; |
151 ngx_table_elt_t *x_real_ip; | 151 ngx_table_elt_t *x_real_ip; |
152 ngx_table_elt_t *x_url; | 152 ngx_table_elt_t *x_url; |
153 #endif | 153 #endif |
154 | 154 |
155 #if (NGX_HTTP_HEADERS) | 155 #if (NGX_HTTP_HEADERS) |
156 ngx_table_elt_t *accept; | 156 ngx_table_elt_t *accept; |
157 ngx_table_elt_t *accept_language; | 157 ngx_table_elt_t *accept_language; |
158 #endif | 158 #endif |
159 | 159 |
160 ngx_array_t cookies; | 160 ngx_array_t cookies; |
161 | 161 |
162 size_t host_name_len; | 162 size_t host_name_len; |
163 ssize_t content_length_n; | 163 ssize_t content_length_n; |
164 size_t connection_type; | 164 time_t keep_alive_n; |
165 ssize_t keep_alive_n; | 165 |
166 | 166 unsigned connection_type:2; |
167 unsigned msie:1; | 167 unsigned msie:1; |
168 unsigned msie4:1; | 168 unsigned msie4:1; |
169 unsigned opera:1; | 169 unsigned opera:1; |
170 unsigned gecko:1; | 170 unsigned gecko:1; |
171 unsigned konqueror:1; | 171 unsigned konqueror:1; |
172 } ngx_http_headers_in_t; | 172 } ngx_http_headers_in_t; |
173 | 173 |
174 | 174 |
175 typedef struct { | 175 typedef struct { |
176 off_t start; | 176 off_t start; |
177 off_t end; | 177 off_t end; |
178 ngx_str_t content_range; | 178 ngx_str_t content_range; |
179 } ngx_http_range_t; | 179 } ngx_http_range_t; |
180 | 180 |
181 | 181 |
182 typedef struct { | 182 typedef struct { |
183 ngx_list_t headers; | 183 ngx_list_t headers; |
184 | 184 |
185 ngx_uint_t status; | 185 ngx_uint_t status; |
186 ngx_str_t status_line; | 186 ngx_str_t status_line; |
187 | 187 |
188 ngx_table_elt_t *server; | 188 ngx_table_elt_t *server; |
189 ngx_table_elt_t *date; | 189 ngx_table_elt_t *date; |
190 ngx_table_elt_t *content_type; | 190 ngx_table_elt_t *content_type; |
191 ngx_table_elt_t *content_length; | 191 ngx_table_elt_t *content_length; |
192 ngx_table_elt_t *content_encoding; | 192 ngx_table_elt_t *content_encoding; |
193 ngx_table_elt_t *location; | 193 ngx_table_elt_t *location; |
194 ngx_table_elt_t *last_modified; | 194 ngx_table_elt_t *last_modified; |
195 ngx_table_elt_t *content_range; | 195 ngx_table_elt_t *content_range; |
196 ngx_table_elt_t *accept_ranges; | 196 ngx_table_elt_t *accept_ranges; |
197 ngx_table_elt_t *expires; | 197 ngx_table_elt_t *expires; |
198 ngx_table_elt_t *cache_control; | 198 ngx_table_elt_t *cache_control; |
199 ngx_table_elt_t *etag; | 199 ngx_table_elt_t *etag; |
200 | 200 |
201 ngx_str_t charset; | 201 ngx_str_t charset; |
202 ngx_array_t ranges; | 202 ngx_array_t ranges; |
203 | 203 |
204 off_t content_length_n; | 204 off_t content_length_n; |
205 time_t date_time; | 205 time_t date_time; |
206 time_t last_modified_time; | 206 time_t last_modified_time; |
207 } ngx_http_headers_out_t; | 207 } ngx_http_headers_out_t; |
208 | 208 |
209 | 209 |
210 typedef void (*ngx_http_client_body_handler_pt)(ngx_http_request_t *r); | 210 typedef void (*ngx_http_client_body_handler_pt)(ngx_http_request_t *r); |
211 | 211 |
219 | 219 |
220 | 220 |
221 struct ngx_http_cleanup_s { | 221 struct ngx_http_cleanup_s { |
222 union { | 222 union { |
223 struct { | 223 struct { |
224 ngx_fd_t fd; | 224 ngx_fd_t fd; |
225 u_char *name; | 225 u_char *name; |
226 } file; | 226 } file; |
227 | 227 |
228 struct { | 228 struct { |
229 ngx_http_cache_hash_t *hash; | 229 ngx_http_cache_hash_t *hash; |
230 ngx_http_cache_entry_t *cache; | 230 ngx_http_cache_entry_t *cache; |
231 } cache; | 231 } cache; |
232 } data; | 232 } data; |
233 | 233 |
234 unsigned valid:1; | 234 unsigned valid:1; |
235 unsigned cache:1; | 235 unsigned cache:1; |
236 }; | 236 }; |
237 | 237 |
238 | 238 |
239 typedef struct { | 239 typedef struct { |
240 ngx_http_request_t *request; | 240 ngx_http_request_t *request; |
241 | 241 |
242 ngx_buf_t **busy; | 242 ngx_buf_t **busy; |
243 ngx_int_t nbusy; | 243 ngx_int_t nbusy; |
244 | 244 |
245 ngx_buf_t **free; | 245 ngx_buf_t **free; |
246 ngx_int_t nfree; | 246 ngx_int_t nfree; |
247 | 247 |
248 ngx_uint_t pipeline; /* unsigned pipeline:1; */ | 248 ngx_uint_t pipeline; /* unsigned pipeline:1; */ |
249 } ngx_http_connection_t; | 249 } ngx_http_connection_t; |
250 | 250 |
251 | 251 |
252 typedef ngx_int_t (*ngx_http_handler_pt)(ngx_http_request_t *r); | 252 typedef ngx_int_t (*ngx_http_handler_pt)(ngx_http_request_t *r); |
253 | 253 |
254 struct ngx_http_request_s { | 254 struct ngx_http_request_s { |
255 uint32_t signature; /* "HTTP" */ | 255 uint32_t signature; /* "HTTP" */ |
256 | 256 |
257 ngx_connection_t *connection; | 257 ngx_connection_t *connection; |
258 | 258 |
259 void **ctx; | 259 void **ctx; |
260 void **main_conf; | 260 void **main_conf; |
261 void **srv_conf; | 261 void **srv_conf; |
262 void **loc_conf; | 262 void **loc_conf; |
263 | 263 |
264 ngx_http_cache_t *cache; | 264 ngx_http_cache_t *cache; |
265 | 265 |
266 ngx_http_upstream_t *upstream; | 266 ngx_http_upstream_t *upstream; |
267 | 267 |
268 ngx_file_t file; | 268 ngx_file_t file; |
269 | 269 |
270 ngx_pool_t *pool; | 270 ngx_pool_t *pool; |
271 ngx_buf_t *header_in; | 271 ngx_buf_t *header_in; |
272 | 272 |
273 ngx_http_headers_in_t headers_in; | 273 ngx_http_headers_in_t headers_in; |
274 ngx_http_headers_out_t headers_out; | 274 ngx_http_headers_out_t headers_out; |
275 | 275 |
276 ngx_http_request_body_t *request_body; | 276 ngx_http_request_body_t *request_body; |
277 | 277 |
278 time_t lingering_time; | 278 time_t lingering_time; |
279 time_t start_time; | 279 time_t start_time; |
280 | 280 |
281 ngx_uint_t method; | 281 ngx_uint_t method; |
282 ngx_uint_t http_version; | 282 ngx_uint_t http_version; |
283 ngx_uint_t http_major; | 283 ngx_uint_t http_major; |
284 ngx_uint_t http_minor; | 284 ngx_uint_t http_minor; |
285 | 285 |
286 ngx_str_t request_line; | 286 ngx_str_t request_line; |
287 ngx_str_t uri; | 287 ngx_str_t uri; |
288 ngx_str_t args; | 288 ngx_str_t args; |
289 ngx_str_t exten; | 289 ngx_str_t exten; |
290 ngx_str_t unparsed_uri; | 290 ngx_str_t unparsed_uri; |
291 | 291 |
292 ngx_str_t method_name; | 292 ngx_str_t method_name; |
293 ngx_str_t http_protocol; | 293 ngx_str_t http_protocol; |
294 | 294 |
295 ngx_http_request_t *main; | 295 ngx_http_request_t *main; |
296 | 296 |
297 uint32_t in_addr; | 297 uint32_t in_addr; |
298 ngx_uint_t port; | 298 ngx_uint_t port; |
299 ngx_str_t *port_text; /* ":80" */ | 299 ngx_str_t *port_text; /* ":80" */ |
300 ngx_str_t server_name; | 300 ngx_str_t server_name; |
301 ngx_http_in_addr_t *virtual_names; | 301 ngx_http_in_addr_t *virtual_names; |
302 | 302 |
303 ngx_uint_t phase; | 303 ngx_uint_t phase; |
304 ngx_int_t phase_handler; | 304 ngx_int_t phase_handler; |
305 ngx_http_handler_pt content_handler; | 305 ngx_http_handler_pt content_handler; |
306 | 306 |
307 ngx_uint_t nvariables; | 307 ngx_http_variable_value_t **variables; |
308 void **variables; | 308 |
309 | 309 ngx_array_t cleanup; |
310 ngx_array_t cleanup; | |
311 | 310 |
312 /* used to learn the Apache compatible response length without a header */ | 311 /* used to learn the Apache compatible response length without a header */ |
313 size_t header_size; | 312 size_t header_size; |
314 | 313 |
315 size_t request_length; | 314 size_t request_length; |
316 | 315 |
317 u_char *discarded_buffer; | 316 u_char *discarded_buffer; |
318 void **err_ctx; | 317 void **err_ctx; |
319 ngx_uint_t err_status; | 318 ngx_uint_t err_status; |
320 | 319 |
321 ngx_http_connection_t *http_connection; | 320 ngx_http_connection_t *http_connection; |
322 | 321 |
323 unsigned http_state:4; | 322 unsigned http_state:4; |
324 | 323 |
325 /* URI with "/." and on Win32 with "//" */ | 324 /* URI with "/." and on Win32 with "//" */ |
326 unsigned complex_uri:1; | 325 unsigned complex_uri:1; |
327 | 326 |
328 /* URI with "%" */ | 327 /* URI with "%" */ |
329 unsigned quoted_uri:1; | 328 unsigned quoted_uri:1; |
330 | 329 |
331 /* URI with "+" */ | 330 /* URI with "+" */ |
332 unsigned plus_in_uri:1; | 331 unsigned plus_in_uri:1; |
333 | 332 |
334 /* URI with "\0" or "%00" */ | 333 /* URI with "\0" or "%00" */ |
335 unsigned zero_in_uri:1; | 334 unsigned zero_in_uri:1; |
336 | 335 |
337 unsigned uri_changed:1; | 336 unsigned uri_changed:1; |
338 unsigned uri_changes:4; | 337 unsigned uri_changes:4; |
339 | 338 |
340 unsigned low_case_exten:1; | 339 unsigned low_case_exten:1; |
341 unsigned header_timeout_set:1; | 340 unsigned header_timeout_set:1; |
342 | 341 |
343 unsigned proxy:1; | 342 unsigned proxy:1; |
344 unsigned bypass_cache:1; | 343 unsigned bypass_cache:1; |
345 unsigned no_cache:1; | 344 unsigned no_cache:1; |
346 | 345 |
347 #if 0 | 346 #if 0 |
348 unsigned cachable:1; | 347 unsigned cachable:1; |
349 #endif | 348 #endif |
350 unsigned pipeline:1; | 349 unsigned pipeline:1; |
351 | 350 |
352 unsigned plain_http:1; | 351 unsigned plain_http:1; |
353 unsigned chunked:1; | 352 unsigned chunked:1; |
354 unsigned header_only:1; | 353 unsigned header_only:1; |
355 unsigned keepalive:1; | 354 unsigned keepalive:1; |
356 unsigned lingering_close:1; | 355 unsigned lingering_close:1; |
357 unsigned closed:1; | 356 unsigned closed:1; |
358 | 357 |
359 unsigned filter_need_in_memory:1; | 358 unsigned filter_need_in_memory:1; |
360 unsigned filter_ssi_need_in_memory:1; | 359 unsigned filter_ssi_need_in_memory:1; |
361 unsigned filter_need_temporary:1; | 360 unsigned filter_need_temporary:1; |
362 unsigned filter_allow_ranges:1; | 361 unsigned filter_allow_ranges:1; |
363 | 362 |
364 #if (NGX_STAT_STUB) | 363 #if (NGX_STAT_STUB) |
365 unsigned stat_reading:1; | 364 unsigned stat_reading:1; |
366 unsigned stat_writing:1; | 365 unsigned stat_writing:1; |
367 #endif | 366 #endif |
368 | 367 |
369 ngx_uint_t headers_n; | 368 ngx_uint_t headers_n; |
370 | 369 |
371 /* used to parse HTTP headers */ | 370 /* used to parse HTTP headers */ |
372 ngx_uint_t state; | 371 ngx_uint_t state; |
373 u_char *uri_start; | 372 u_char *uri_start; |
374 u_char *uri_end; | 373 u_char *uri_end; |
375 u_char *uri_ext; | 374 u_char *uri_ext; |
376 u_char *args_start; | 375 u_char *args_start; |
377 u_char *request_start; | 376 u_char *request_start; |
378 u_char *request_end; | 377 u_char *request_end; |
379 u_char *method_end; | 378 u_char *method_end; |
380 u_char *schema_start; | 379 u_char *schema_start; |
381 u_char *schema_end; | 380 u_char *schema_end; |
382 u_char *host_start; | 381 u_char *host_start; |
383 u_char *host_end; | 382 u_char *host_end; |
384 u_char *port_start; | 383 u_char *port_start; |
385 u_char *port_end; | 384 u_char *port_end; |
386 u_char *header_name_start; | 385 u_char *header_name_start; |
387 u_char *header_name_end; | 386 u_char *header_name_end; |
388 u_char *header_start; | 387 u_char *header_start; |
389 u_char *header_end; | 388 u_char *header_end; |
390 }; | 389 }; |
391 | 390 |
392 | 391 |
393 extern ngx_http_header_t ngx_http_headers_in[]; | 392 extern ngx_http_header_t ngx_http_headers_in[]; |
394 extern ngx_http_header_t ngx_http_headers_out[]; | 393 extern ngx_http_header_t ngx_http_headers_out[]; |