Mercurial > hg > nginx
comparison src/http/ngx_http_request_body.c @ 1072:f303d33f3927
delete temporary file for incomplete small request body
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 23 Jan 2007 12:55:23 +0000 |
parents | 9039e845e532 |
children | 4d203f76b757 |
comparison
equal
deleted
inserted
replaced
1071:bd4202f92581 | 1072:f303d33f3927 |
---|---|
30 ngx_http_read_client_request_body(ngx_http_request_t *r, | 30 ngx_http_read_client_request_body(ngx_http_request_t *r, |
31 ngx_http_client_body_handler_pt post_handler) | 31 ngx_http_client_body_handler_pt post_handler) |
32 { | 32 { |
33 size_t preread; | 33 size_t preread; |
34 ssize_t size; | 34 ssize_t size; |
35 ngx_int_t rc; | |
35 ngx_buf_t *b; | 36 ngx_buf_t *b; |
36 ngx_chain_t *cl, **next; | 37 ngx_chain_t *cl, **next; |
37 ngx_temp_file_t *tf; | 38 ngx_temp_file_t *tf; |
38 ngx_http_request_body_t *rb; | 39 ngx_http_request_body_t *rb; |
39 ngx_http_core_loc_conf_t *clcf; | 40 ngx_http_core_loc_conf_t *clcf; |
165 | 166 |
166 rb->to_write = rb->bufs; | 167 rb->to_write = rb->bufs; |
167 | 168 |
168 r->read_event_handler = ngx_http_read_client_request_body_handler; | 169 r->read_event_handler = ngx_http_read_client_request_body_handler; |
169 | 170 |
170 return ngx_http_do_read_client_request_body(r); | 171 rc = ngx_http_do_read_client_request_body(r); |
172 | |
173 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { | |
174 ngx_http_finalize_request_body(r, rc); | |
175 return NGX_DONE; | |
176 } | |
177 | |
178 return rc; | |
171 } | 179 } |
172 | 180 |
173 next = &rb->bufs->next; | 181 next = &rb->bufs->next; |
174 | 182 |
175 } else { | 183 } else { |
225 rb->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs; | 233 rb->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs; |
226 } | 234 } |
227 | 235 |
228 r->read_event_handler = ngx_http_read_client_request_body_handler; | 236 r->read_event_handler = ngx_http_read_client_request_body_handler; |
229 | 237 |
230 return ngx_http_do_read_client_request_body(r); | 238 rc = ngx_http_do_read_client_request_body(r); |
239 | |
240 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { | |
241 ngx_http_finalize_request_body(r, rc); | |
242 return NGX_DONE; | |
243 } | |
244 | |
245 return rc; | |
231 } | 246 } |
232 | 247 |
233 | 248 |
234 static void | 249 static void |
235 ngx_http_read_client_request_body_handler(ngx_http_request_t *r) | 250 ngx_http_read_client_request_body_handler(ngx_http_request_t *r) |