Mercurial > hg > nginx
comparison src/http/ngx_http_request_body.c @ 6048:9e231d4cecca
Request body: moved request body writing to save filter.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 23 Mar 2015 21:09:19 +0300 |
parents | e2e609f59094 |
children | 42d9beeb22db |
comparison
equal
deleted
inserted
replaced
6047:e2e609f59094 | 6048:9e231d4cecca |
---|---|
275 | 275 |
276 if (rc != NGX_OK) { | 276 if (rc != NGX_OK) { |
277 return rc; | 277 return rc; |
278 } | 278 } |
279 | 279 |
280 /* write to file */ | |
281 | |
282 if (ngx_http_write_request_body(r) != NGX_OK) { | |
283 return NGX_HTTP_INTERNAL_SERVER_ERROR; | |
284 } | |
285 | |
286 /* update chains */ | |
287 | |
288 rc = ngx_http_request_body_filter(r, NULL); | |
289 | |
290 if (rc != NGX_OK) { | |
291 return rc; | |
292 } | |
293 | |
294 if (rb->busy != NULL) { | 280 if (rb->busy != NULL) { |
295 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 281 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
296 } | 282 } |
297 | 283 |
298 rb->buf->pos = rb->buf->start; | 284 rb->buf->pos = rb->buf->start; |
1098 | 1084 |
1099 if (ngx_chain_add_copy(r->pool, &rb->bufs, in) != NGX_OK) { | 1085 if (ngx_chain_add_copy(r->pool, &rb->bufs, in) != NGX_OK) { |
1100 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 1086 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
1101 } | 1087 } |
1102 | 1088 |
1089 if (rb->rest > 0 | |
1090 && rb->buf && rb->buf->last == rb->buf->end) | |
1091 { | |
1092 if (ngx_http_write_request_body(r) != NGX_OK) { | |
1093 return NGX_HTTP_INTERNAL_SERVER_ERROR; | |
1094 } | |
1095 } | |
1096 | |
1103 return NGX_OK; | 1097 return NGX_OK; |
1104 } | 1098 } |