diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index 241d83e94..f6d71e2f7 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -2292,7 +2292,6 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b, sw_chunk_extension_unquoted_value, sw_chunk_extension_almost_done, sw_chunk_data, - sw_after_data, sw_after_data_almost_done, sw_trailer, sw_trailer_almost_done, @@ -2303,10 +2302,6 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b, state = ctx->state; - if (state == sw_chunk_data && ctx->size == 0) { - state = sw_after_data; - } - rc = NGX_AGAIN; for (pos = b->pos; pos < b->last; pos++) { @@ -2470,10 +2465,10 @@ before_semi: goto invalid; case sw_chunk_data: - rc = NGX_OK; - goto data; - - case sw_after_data: + if (ctx->size != 0) { + rc = NGX_OK; + goto data; + } if (ch == CR) { state = sw_after_data_almost_done; break; @@ -2608,9 +2603,6 @@ data: case sw_chunk_data: ctx->length = min_length; break; - case sw_after_data: - ctx->length = 6 /* CR LF "0" CR LF LF */; - break; case sw_after_data_almost_done: ctx->length = 5 /* LF "0" CR LF LF */; break;