Mercurial > hg > nginx
comparison src/http/ngx_http_request_body.c @ 6049:42d9beeb22db
Request body: filters support.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 23 Mar 2015 21:09:19 +0300 |
parents | 9e231d4cecca |
children | a08fad30aeac |
comparison
equal
deleted
inserted
replaced
6048:9e231d4cecca | 6049:42d9beeb22db |
---|---|
21 static ngx_int_t ngx_http_request_body_filter(ngx_http_request_t *r, | 21 static ngx_int_t ngx_http_request_body_filter(ngx_http_request_t *r, |
22 ngx_chain_t *in); | 22 ngx_chain_t *in); |
23 static ngx_int_t ngx_http_request_body_length_filter(ngx_http_request_t *r, | 23 static ngx_int_t ngx_http_request_body_length_filter(ngx_http_request_t *r, |
24 ngx_chain_t *in); | 24 ngx_chain_t *in); |
25 static ngx_int_t ngx_http_request_body_chunked_filter(ngx_http_request_t *r, | 25 static ngx_int_t ngx_http_request_body_chunked_filter(ngx_http_request_t *r, |
26 ngx_chain_t *in); | |
27 static ngx_int_t ngx_http_request_body_save_filter(ngx_http_request_t *r, | |
28 ngx_chain_t *in); | 26 ngx_chain_t *in); |
29 | 27 |
30 | 28 |
31 ngx_int_t | 29 ngx_int_t |
32 ngx_http_read_client_request_body(ngx_http_request_t *r, | 30 ngx_http_read_client_request_body(ngx_http_request_t *r, |
881 | 879 |
882 *ll = tl; | 880 *ll = tl; |
883 ll = &tl->next; | 881 ll = &tl->next; |
884 } | 882 } |
885 | 883 |
886 rc = ngx_http_request_body_save_filter(r, out); | 884 rc = ngx_http_top_request_body_filter(r, out); |
887 | 885 |
888 ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out, | 886 ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out, |
889 (ngx_buf_tag_t) &ngx_http_read_client_request_body); | 887 (ngx_buf_tag_t) &ngx_http_read_client_request_body); |
890 | 888 |
891 return rc; | 889 return rc; |
1033 | 1031 |
1034 return NGX_HTTP_BAD_REQUEST; | 1032 return NGX_HTTP_BAD_REQUEST; |
1035 } | 1033 } |
1036 } | 1034 } |
1037 | 1035 |
1038 rc = ngx_http_request_body_save_filter(r, out); | 1036 rc = ngx_http_top_request_body_filter(r, out); |
1039 | 1037 |
1040 ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out, | 1038 ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out, |
1041 (ngx_buf_tag_t) &ngx_http_read_client_request_body); | 1039 (ngx_buf_tag_t) &ngx_http_read_client_request_body); |
1042 | 1040 |
1043 return rc; | 1041 return rc; |
1044 } | 1042 } |
1045 | 1043 |
1046 | 1044 |
1047 static ngx_int_t | 1045 ngx_int_t |
1048 ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in) | 1046 ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in) |
1049 { | 1047 { |
1050 #if (NGX_DEBUG) | 1048 #if (NGX_DEBUG) |
1051 ngx_chain_t *cl; | 1049 ngx_chain_t *cl; |
1052 #endif | 1050 #endif |