mirror of
https://github.com/nginx/nginx.git
synced 2025-06-25 16:00:40 +08:00
HTTP/3: move body parser call out of ngx_http_parse_chunked().
The function ngx_http_parse_chunked() is also called from the proxy module to parse the upstream response. It should always parse HTTP/1 body in this case.
This commit is contained in:
parent
1c54340e0a
commit
d69f678e9c
@ -2185,12 +2185,6 @@ ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
|
|||||||
sw_trailer_header_almost_done
|
sw_trailer_header_almost_done
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
#if (NGX_HTTP_V3)
|
|
||||||
if (r->http_version == NGX_HTTP_VERSION_30) {
|
|
||||||
return ngx_http_v3_parse_request_body(r, b, ctx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
state = ctx->state;
|
state = ctx->state;
|
||||||
|
|
||||||
if (state == sw_chunk_data && ctx->size == 0) {
|
if (state == sw_chunk_data && ctx->size == 0) {
|
||||||
|
@ -735,7 +735,16 @@ ngx_http_discard_request_body_filter(ngx_http_request_t *r, ngx_buf_t *b)
|
|||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
|
|
||||||
|
switch (r->http_version) {
|
||||||
|
#if (NGX_HTTP_V3)
|
||||||
|
case NGX_HTTP_VERSION_30:
|
||||||
|
rc = ngx_http_v3_parse_request_body(r, b, rb->chunked);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
default: /* HTTP/1.x */
|
||||||
rc = ngx_http_parse_chunked(r, b, rb->chunked);
|
rc = ngx_http_parse_chunked(r, b, rb->chunked);
|
||||||
|
}
|
||||||
|
|
||||||
if (rc == NGX_OK) {
|
if (rc == NGX_OK) {
|
||||||
|
|
||||||
@ -978,7 +987,16 @@ ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
|||||||
cl->buf->file_pos,
|
cl->buf->file_pos,
|
||||||
cl->buf->file_last - cl->buf->file_pos);
|
cl->buf->file_last - cl->buf->file_pos);
|
||||||
|
|
||||||
|
switch (r->http_version) {
|
||||||
|
#if (NGX_HTTP_V3)
|
||||||
|
case NGX_HTTP_VERSION_30:
|
||||||
|
rc = ngx_http_v3_parse_request_body(r, cl->buf, rb->chunked);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
default: /* HTTP/1.x */
|
||||||
rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked);
|
rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked);
|
||||||
|
}
|
||||||
|
|
||||||
if (rc == NGX_OK) {
|
if (rc == NGX_OK) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user