client_body_in_file_only any
Igor Sysoev
15 years ago
20 | 20 | #define NGX_HTTP_LOCATION_AUTO_REDIRECT 2 |
21 | 21 | #define NGX_HTTP_LOCATION_NOREGEX 3 |
22 | 22 | #define NGX_HTTP_LOCATION_REGEX 4 |
23 | ||
24 | ||
25 | #define NGX_HTTP_REQUEST_BODY_FILE_OFF 0 | |
26 | #define NGX_HTTP_REQUEST_BODY_FILE_ON 1 | |
27 | #define NGX_HTTP_REQUEST_BODY_FILE_ANY 2 | |
23 | 28 | |
24 | 29 | |
25 | 30 | static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r, |
73 | 78 | }; |
74 | 79 | |
75 | 80 | |
81 | static ngx_conf_enum_t ngx_http_core_request_body_in_file[] = { | |
82 | { ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF }, | |
83 | { ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON }, | |
84 | { ngx_string("any"), NGX_HTTP_REQUEST_BODY_FILE_ANY }, | |
85 | { ngx_null_string, 0 } | |
86 | }; | |
87 | ||
88 | ||
76 | 89 | static ngx_command_t ngx_http_core_commands[] = { |
77 | 90 | |
78 | 91 | { ngx_string("variables_hash_max_size"), |
268 | 281 | |
269 | 282 | { ngx_string("client_body_in_file_only"), |
270 | 283 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
271 | ngx_conf_set_flag_slot, | |
284 | ngx_conf_set_enum_slot, | |
272 | 285 | NGX_HTTP_LOC_CONF_OFFSET, |
273 | 286 | offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only), |
274 | NULL }, | |
287 | &ngx_http_core_request_body_in_file }, | |
275 | 288 | |
276 | 289 | { ngx_string("sendfile"), |
277 | 290 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
877 | 890 | r->request_body_in_file_only = 1; |
878 | 891 | r->request_body_in_persistent_file = 1; |
879 | 892 | r->request_body_file_log_level = NGX_LOG_NOTICE; |
893 | ||
894 | if (clcf->client_body_in_file_only == NGX_HTTP_REQUEST_BODY_FILE_ON) { | |
895 | r->request_body_delete_incomplete_file = 1; | |
896 | } | |
880 | 897 | |
881 | 898 | } else { |
882 | 899 | r->request_body_file_log_level = NGX_LOG_WARN; |