$request_body_file
Igor Sysoev
15 years ago
48 | 48 | static ngx_int_t ngx_http_variable_body_bytes_sent(ngx_http_request_t *r, |
49 | 49 | ngx_http_variable_value_t *v, uintptr_t data); |
50 | 50 | static ngx_int_t ngx_http_variable_request_completion(ngx_http_request_t *r, |
51 | ngx_http_variable_value_t *v, uintptr_t data); | |
52 | static ngx_int_t ngx_http_variable_request_body_file(ngx_http_request_t *r, | |
51 | 53 | ngx_http_variable_value_t *v, uintptr_t data); |
52 | 54 | |
53 | 55 | static ngx_int_t ngx_http_variable_sent_content_type(ngx_http_request_t *r, |
169 | 171 | ngx_http_variable_request_completion, |
170 | 172 | 0, 0, 0 }, |
171 | 173 | |
174 | { ngx_string("request_body_file"), NULL, | |
175 | ngx_http_variable_request_body_file, | |
176 | 0, 0, 0 }, | |
177 | ||
172 | 178 | { ngx_string("sent_http_content_type"), NULL, |
173 | 179 | ngx_http_variable_sent_content_type, 0, 0, 0 }, |
174 | 180 | |
1133 | 1139 | } |
1134 | 1140 | |
1135 | 1141 | |
1142 | static ngx_int_t | |
1143 | ngx_http_variable_request_body_file(ngx_http_request_t *r, | |
1144 | ngx_http_variable_value_t *v, uintptr_t data) | |
1145 | { | |
1146 | if (r->request_body == NULL || r->request_body->temp_file == NULL) { | |
1147 | v->len = 0; | |
1148 | v->valid = 1; | |
1149 | v->no_cachable = 0; | |
1150 | v->not_found = 0; | |
1151 | v->data = (u_char *) ""; | |
1152 | ||
1153 | return NGX_OK; | |
1154 | } | |
1155 | ||
1156 | v->len = r->request_body->temp_file->file.name.len; | |
1157 | v->valid = 1; | |
1158 | v->no_cachable = 0; | |
1159 | v->not_found = 0; | |
1160 | v->data = r->request_body->temp_file->file.name.data; | |
1161 | ||
1162 | return NGX_OK; | |
1163 | } | |
1164 | ||
1165 | ||
1136 | 1166 | ngx_int_t |
1137 | 1167 | ngx_http_variables_add_core_vars(ngx_conf_t *cf) |
1138 | 1168 | { |