Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 1073:d82560e9d147
client_body_in_file_only any
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 24 Jan 2007 09:14:08 +0000 |
parents | b54a1e283d6d |
children | 4d203f76b757 |
comparison
equal
deleted
inserted
replaced
1072:f303d33f3927 | 1073:d82560e9d147 |
---|---|
19 | 19 |
20 #define NGX_HTTP_LOCATION_EXACT 1 | 20 #define NGX_HTTP_LOCATION_EXACT 1 |
21 #define NGX_HTTP_LOCATION_AUTO_REDIRECT 2 | 21 #define NGX_HTTP_LOCATION_AUTO_REDIRECT 2 |
22 #define NGX_HTTP_LOCATION_NOREGEX 3 | 22 #define NGX_HTTP_LOCATION_NOREGEX 3 |
23 #define NGX_HTTP_LOCATION_REGEX 4 | 23 #define NGX_HTTP_LOCATION_REGEX 4 |
24 | |
25 | |
26 #define NGX_HTTP_REQUEST_BODY_FILE_OFF 0 | |
27 #define NGX_HTTP_REQUEST_BODY_FILE_ON 1 | |
28 #define NGX_HTTP_REQUEST_BODY_FILE_ANY 2 | |
24 | 29 |
25 | 30 |
26 static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r, | 31 static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r, |
27 ngx_array_t *locations, size_t len); | 32 ngx_array_t *locations, size_t len); |
28 | 33 |
72 static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_host_names = { | 77 static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_host_names = { |
73 ngx_conf_deprecated, "optimize_host_names", "optimize_server_names" | 78 ngx_conf_deprecated, "optimize_host_names", "optimize_server_names" |
74 }; | 79 }; |
75 | 80 |
76 | 81 |
82 static ngx_conf_enum_t ngx_http_core_request_body_in_file[] = { | |
83 { ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF }, | |
84 { ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON }, | |
85 { ngx_string("any"), NGX_HTTP_REQUEST_BODY_FILE_ANY }, | |
86 { ngx_null_string, 0 } | |
87 }; | |
88 | |
89 | |
77 static ngx_command_t ngx_http_core_commands[] = { | 90 static ngx_command_t ngx_http_core_commands[] = { |
78 | 91 |
79 { ngx_string("variables_hash_max_size"), | 92 { ngx_string("variables_hash_max_size"), |
80 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | 93 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, |
81 ngx_conf_set_num_slot, | 94 ngx_conf_set_num_slot, |
267 offsetof(ngx_http_core_loc_conf_t, client_body_temp_path), | 280 offsetof(ngx_http_core_loc_conf_t, client_body_temp_path), |
268 (void *) ngx_garbage_collector_temp_handler }, | 281 (void *) ngx_garbage_collector_temp_handler }, |
269 | 282 |
270 { ngx_string("client_body_in_file_only"), | 283 { ngx_string("client_body_in_file_only"), |
271 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 284 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
272 ngx_conf_set_flag_slot, | 285 ngx_conf_set_enum_slot, |
273 NGX_HTTP_LOC_CONF_OFFSET, | 286 NGX_HTTP_LOC_CONF_OFFSET, |
274 offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only), | 287 offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only), |
275 NULL }, | 288 &ngx_http_core_request_body_in_file }, |
276 | 289 |
277 { ngx_string("sendfile"), | 290 { ngx_string("sendfile"), |
278 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF | 291 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
279 |NGX_CONF_TAKE1, | 292 |NGX_CONF_TAKE1, |
280 ngx_conf_set_flag_slot, | 293 ngx_conf_set_flag_slot, |
876 | 889 |
877 if (clcf->client_body_in_file_only) { | 890 if (clcf->client_body_in_file_only) { |
878 r->request_body_in_file_only = 1; | 891 r->request_body_in_file_only = 1; |
879 r->request_body_in_persistent_file = 1; | 892 r->request_body_in_persistent_file = 1; |
880 r->request_body_file_log_level = NGX_LOG_NOTICE; | 893 r->request_body_file_log_level = NGX_LOG_NOTICE; |
894 | |
895 if (clcf->client_body_in_file_only == NGX_HTTP_REQUEST_BODY_FILE_ON) { | |
896 r->request_body_delete_incomplete_file = 1; | |
897 } | |
881 | 898 |
882 } else { | 899 } else { |
883 r->request_body_file_log_level = NGX_LOG_WARN; | 900 r->request_body_file_log_level = NGX_LOG_WARN; |
884 } | 901 } |
885 | 902 |