Mercurial > hg > nginx-mail
comparison src/http/ngx_http_request.h @ 58:b55cbf18157e NGINX_0_1_29
nginx 0.1.29
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; bug appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 12 May 2005 00:00:00 +0400 |
parents | 3050baa54a26 |
children | df7d3fff122b |
comparison
equal
deleted
inserted
replaced
57:5df375c55338 | 58:b55cbf18157e |
---|---|
4 */ | 4 */ |
5 | 5 |
6 | 6 |
7 #ifndef _NGX_HTTP_REQUEST_H_INCLUDED_ | 7 #ifndef _NGX_HTTP_REQUEST_H_INCLUDED_ |
8 #define _NGX_HTTP_REQUEST_H_INCLUDED_ | 8 #define _NGX_HTTP_REQUEST_H_INCLUDED_ |
9 | |
10 | |
11 #define NGX_HTTP_MAX_REWRITE_CYCLES 10 | |
9 | 12 |
10 | 13 |
11 #define NGX_HTTP_DISCARD_BUFFER_SIZE 4096 | 14 #define NGX_HTTP_DISCARD_BUFFER_SIZE 4096 |
12 #define NGX_HTTP_LINGERING_BUFFER_SIZE 4096 | 15 #define NGX_HTTP_LINGERING_BUFFER_SIZE 4096 |
13 | 16 |
112 | 115 |
113 | 116 |
114 typedef struct { | 117 typedef struct { |
115 ngx_str_t name; | 118 ngx_str_t name; |
116 ngx_uint_t offset; | 119 ngx_uint_t offset; |
120 ngx_http_header_handler_pt handler; | |
117 } ngx_http_header_t; | 121 } ngx_http_header_t; |
122 | |
123 | |
124 typedef struct { | |
125 ngx_str_t name; | |
126 ngx_uint_t offset; | |
127 } ngx_http_header0_t; | |
118 | 128 |
119 | 129 |
120 typedef struct { | 130 typedef struct { |
121 ngx_list_t headers; | 131 ngx_list_t headers; |
122 | 132 |
181 ngx_uint_t status; | 191 ngx_uint_t status; |
182 ngx_str_t status_line; | 192 ngx_str_t status_line; |
183 | 193 |
184 ngx_table_elt_t *server; | 194 ngx_table_elt_t *server; |
185 ngx_table_elt_t *date; | 195 ngx_table_elt_t *date; |
186 ngx_table_elt_t *content_type; | |
187 ngx_table_elt_t *content_length; | 196 ngx_table_elt_t *content_length; |
188 ngx_table_elt_t *content_encoding; | 197 ngx_table_elt_t *content_encoding; |
189 ngx_table_elt_t *location; | 198 ngx_table_elt_t *location; |
190 ngx_table_elt_t *last_modified; | 199 ngx_table_elt_t *last_modified; |
191 ngx_table_elt_t *content_range; | 200 ngx_table_elt_t *content_range; |
192 ngx_table_elt_t *accept_ranges; | 201 ngx_table_elt_t *accept_ranges; |
193 ngx_table_elt_t *www_authenticate; | 202 ngx_table_elt_t *www_authenticate; |
194 ngx_table_elt_t *expires; | 203 ngx_table_elt_t *expires; |
195 ngx_table_elt_t *cache_control; | |
196 ngx_table_elt_t *etag; | 204 ngx_table_elt_t *etag; |
197 | 205 |
206 ngx_str_t content_type; | |
198 ngx_str_t charset; | 207 ngx_str_t charset; |
199 ngx_array_t ranges; | 208 ngx_array_t ranges; |
209 | |
210 ngx_array_t cache_control; | |
200 | 211 |
201 off_t content_length_n; | 212 off_t content_length_n; |
202 time_t date_time; | 213 time_t date_time; |
203 time_t last_modified_time; | 214 time_t last_modified_time; |
204 } ngx_http_headers_out_t; | 215 } ngx_http_headers_out_t; |
213 size_t rest; | 224 size_t rest; |
214 ngx_http_client_body_handler_pt post_handler; | 225 ngx_http_client_body_handler_pt post_handler; |
215 } ngx_http_request_body_t; | 226 } ngx_http_request_body_t; |
216 | 227 |
217 | 228 |
218 struct ngx_http_cleanup_s { | |
219 union { | |
220 struct { | |
221 ngx_fd_t fd; | |
222 u_char *name; | |
223 } file; | |
224 | |
225 struct { | |
226 ngx_http_cache_hash_t *hash; | |
227 ngx_http_cache_entry_t *cache; | |
228 } cache; | |
229 } data; | |
230 | |
231 unsigned valid:1; | |
232 unsigned cache:1; | |
233 }; | |
234 | |
235 | |
236 typedef struct { | 229 typedef struct { |
237 ngx_http_request_t *request; | 230 ngx_http_request_t *request; |
238 | 231 |
239 ngx_buf_t **busy; | 232 ngx_buf_t **busy; |
240 ngx_int_t nbusy; | 233 ngx_int_t nbusy; |
244 | 237 |
245 ngx_uint_t pipeline; /* unsigned pipeline:1; */ | 238 ngx_uint_t pipeline; /* unsigned pipeline:1; */ |
246 } ngx_http_connection_t; | 239 } ngx_http_connection_t; |
247 | 240 |
248 | 241 |
242 typedef struct ngx_http_postponed_request_s ngx_http_postponed_request_t; | |
243 | |
244 struct ngx_http_postponed_request_s { | |
245 ngx_http_request_t *request; | |
246 ngx_chain_t *out; | |
247 ngx_http_postponed_request_t *next; | |
248 }; | |
249 | |
250 | |
249 typedef ngx_int_t (*ngx_http_handler_pt)(ngx_http_request_t *r); | 251 typedef ngx_int_t (*ngx_http_handler_pt)(ngx_http_request_t *r); |
252 typedef void (*ngx_http_event_handler_pt)(ngx_http_request_t *r); | |
253 | |
250 | 254 |
251 struct ngx_http_request_s { | 255 struct ngx_http_request_s { |
252 uint32_t signature; /* "HTTP" */ | 256 uint32_t signature; /* "HTTP" */ |
253 | 257 |
254 ngx_connection_t *connection; | 258 ngx_connection_t *connection; |
256 void **ctx; | 260 void **ctx; |
257 void **main_conf; | 261 void **main_conf; |
258 void **srv_conf; | 262 void **srv_conf; |
259 void **loc_conf; | 263 void **loc_conf; |
260 | 264 |
265 ngx_http_event_handler_pt read_event_handler; | |
266 ngx_http_event_handler_pt write_event_handler; | |
267 | |
261 ngx_http_cache_t *cache; | 268 ngx_http_cache_t *cache; |
262 | 269 |
263 ngx_http_upstream_t *upstream; | 270 ngx_http_upstream_t *upstream; |
264 | |
265 ngx_file_t file; | |
266 | 271 |
267 ngx_pool_t *pool; | 272 ngx_pool_t *pool; |
268 ngx_buf_t *header_in; | 273 ngx_buf_t *header_in; |
269 | 274 |
270 ngx_http_headers_in_t headers_in; | 275 ngx_http_headers_in_t headers_in; |
287 ngx_str_t unparsed_uri; | 292 ngx_str_t unparsed_uri; |
288 | 293 |
289 ngx_str_t method_name; | 294 ngx_str_t method_name; |
290 ngx_str_t http_protocol; | 295 ngx_str_t http_protocol; |
291 | 296 |
297 ngx_chain_t *out; | |
292 ngx_http_request_t *main; | 298 ngx_http_request_t *main; |
299 ngx_http_request_t *parent; | |
300 ngx_http_postponed_request_t *postponed; | |
293 | 301 |
294 uint32_t in_addr; | 302 uint32_t in_addr; |
295 ngx_uint_t port; | 303 ngx_uint_t port; |
296 ngx_str_t *port_text; /* ":80" */ | 304 ngx_str_t *port_text; /* ":80" */ |
297 ngx_str_t server_name; | 305 ngx_str_t server_name; |
301 ngx_int_t phase_handler; | 309 ngx_int_t phase_handler; |
302 ngx_http_handler_pt content_handler; | 310 ngx_http_handler_pt content_handler; |
303 | 311 |
304 ngx_http_variable_value_t **variables; | 312 ngx_http_variable_value_t **variables; |
305 | 313 |
306 ngx_array_t cleanup; | |
307 | |
308 /* used to learn the Apache compatible response length without a header */ | 314 /* used to learn the Apache compatible response length without a header */ |
309 size_t header_size; | 315 size_t header_size; |
310 | 316 |
311 size_t request_length; | 317 size_t request_length; |
312 | 318 |
313 u_char *discarded_buffer; | |
314 void **err_ctx; | 319 void **err_ctx; |
315 ngx_uint_t err_status; | 320 ngx_uint_t err_status; |
316 | 321 |
317 ngx_http_connection_t *http_connection; | 322 ngx_http_connection_t *http_connection; |
318 | 323 |
324 ngx_http_log_handler_pt log_handler; | |
325 | |
319 unsigned http_state:4; | 326 unsigned http_state:4; |
320 | 327 |
321 /* URI with "/." and on Win32 with "//" */ | 328 /* URI with "/." and on Win32 with "//" */ |
322 unsigned complex_uri:1; | 329 unsigned complex_uri:1; |
323 | 330 |
328 unsigned plus_in_uri:1; | 335 unsigned plus_in_uri:1; |
329 | 336 |
330 /* URI with "\0" or "%00" */ | 337 /* URI with "\0" or "%00" */ |
331 unsigned zero_in_uri:1; | 338 unsigned zero_in_uri:1; |
332 | 339 |
340 unsigned valid_location:1; | |
333 unsigned valid_unparsed_uri:1; | 341 unsigned valid_unparsed_uri:1; |
334 unsigned uri_changed:1; | 342 unsigned uri_changed:1; |
335 unsigned uri_changes:4; | 343 unsigned uri_changes:4; |
336 | 344 |
337 unsigned invalid_header:1; | |
338 | |
339 unsigned low_case_exten:1; | 345 unsigned low_case_exten:1; |
340 unsigned header_timeout_set:1; | 346 unsigned header_timeout_set:1; |
341 | 347 |
342 unsigned proxy:1; | 348 unsigned proxy:1; |
343 unsigned bypass_cache:1; | 349 unsigned bypass_cache:1; |
344 unsigned no_cache:1; | 350 unsigned no_cache:1; |
345 | 351 |
346 #if 0 | 352 #if 0 |
347 unsigned cachable:1; | 353 unsigned cachable:1; |
348 #endif | 354 #endif |
355 | |
349 unsigned pipeline:1; | 356 unsigned pipeline:1; |
350 | |
351 unsigned plain_http:1; | 357 unsigned plain_http:1; |
352 unsigned chunked:1; | 358 unsigned chunked:1; |
353 unsigned header_only:1; | 359 unsigned header_only:1; |
354 unsigned keepalive:1; | 360 unsigned keepalive:1; |
355 unsigned lingering_close:1; | 361 unsigned lingering_close:1; |
362 unsigned internal:1; | |
356 unsigned closed:1; | 363 unsigned closed:1; |
364 unsigned done:1; | |
357 | 365 |
358 unsigned filter_need_in_memory:1; | 366 unsigned filter_need_in_memory:1; |
359 unsigned filter_ssi_need_in_memory:1; | 367 unsigned filter_ssi_need_in_memory:1; |
360 unsigned filter_need_temporary:1; | 368 unsigned filter_need_temporary:1; |
361 unsigned filter_allow_ranges:1; | 369 unsigned filter_allow_ranges:1; |
362 | 370 |
363 #if (NGX_STAT_STUB) | 371 #if (NGX_STAT_STUB) |
364 unsigned stat_reading:1; | 372 unsigned stat_reading:1; |
365 unsigned stat_writing:1; | 373 unsigned stat_writing:1; |
366 #endif | 374 #endif |
367 | |
368 ngx_uint_t headers_n; | |
369 | 375 |
370 /* used to parse HTTP headers */ | 376 /* used to parse HTTP headers */ |
371 ngx_uint_t state; | 377 ngx_uint_t state; |
372 u_char *uri_start; | 378 u_char *uri_start; |
373 u_char *uri_end; | 379 u_char *uri_end; |
389 ngx_uint_t header_hash; | 395 ngx_uint_t header_hash; |
390 }; | 396 }; |
391 | 397 |
392 | 398 |
393 extern ngx_http_header_t ngx_http_headers_in[]; | 399 extern ngx_http_header_t ngx_http_headers_in[]; |
394 extern ngx_http_header_t ngx_http_headers_out[]; | 400 extern ngx_http_header0_t ngx_http_headers_out[]; |
395 | |
396 | 401 |
397 | 402 |
398 #endif /* _NGX_HTTP_REQUEST_H_INCLUDED_ */ | 403 #endif /* _NGX_HTTP_REQUEST_H_INCLUDED_ */ |