aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index f7e50388f..a45c04554 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -2140,7 +2140,7 @@ ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args)
ngx_int_t
ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_http_chunked_t *ctx)
+ ngx_http_chunked_t *ctx, ngx_uint_t keep_trailers)
{
u_char *pos, ch, c;
ngx_int_t rc;
@@ -2218,6 +2218,9 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
state = sw_last_chunk_extension_almost_done;
break;
case LF:
+ if (keep_trailers) {
+ goto done;
+ }
state = sw_trailer;
break;
case ';':
@@ -2297,12 +2300,18 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
state = sw_last_chunk_extension_almost_done;
break;
case LF:
+ if (keep_trailers) {
+ goto done;
+ }
state = sw_trailer;
}
break;
case sw_last_chunk_extension_almost_done:
if (ch == LF) {
+ if (keep_trailers) {
+ goto done;
+ }
state = sw_trailer;
break;
}