Mercurial > hg > nginx
comparison src/http/ngx_http_request_body.c @ 8404:e5d4f057a6cb quic
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.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 14 May 2020 14:49:53 +0300 |
parents | 5649079a41f4 |
children | 532fe796b0e2 |
comparison
equal
deleted
inserted
replaced
8403:c101438c69a4 | 8404:e5d4f057a6cb |
---|---|
733 r->request_body = rb; | 733 r->request_body = rb; |
734 } | 734 } |
735 | 735 |
736 for ( ;; ) { | 736 for ( ;; ) { |
737 | 737 |
738 rc = ngx_http_parse_chunked(r, b, rb->chunked); | 738 switch (r->http_version) { |
739 #if (NGX_HTTP_V3) | |
740 case NGX_HTTP_VERSION_30: | |
741 rc = ngx_http_v3_parse_request_body(r, b, rb->chunked); | |
742 break; | |
743 #endif | |
744 | |
745 default: /* HTTP/1.x */ | |
746 rc = ngx_http_parse_chunked(r, b, rb->chunked); | |
747 } | |
739 | 748 |
740 if (rc == NGX_OK) { | 749 if (rc == NGX_OK) { |
741 | 750 |
742 /* a chunk has been parsed successfully */ | 751 /* a chunk has been parsed successfully */ |
743 | 752 |
976 cl->buf->start, cl->buf->pos, | 985 cl->buf->start, cl->buf->pos, |
977 cl->buf->last - cl->buf->pos, | 986 cl->buf->last - cl->buf->pos, |
978 cl->buf->file_pos, | 987 cl->buf->file_pos, |
979 cl->buf->file_last - cl->buf->file_pos); | 988 cl->buf->file_last - cl->buf->file_pos); |
980 | 989 |
981 rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked); | 990 switch (r->http_version) { |
991 #if (NGX_HTTP_V3) | |
992 case NGX_HTTP_VERSION_30: | |
993 rc = ngx_http_v3_parse_request_body(r, cl->buf, rb->chunked); | |
994 break; | |
995 #endif | |
996 | |
997 default: /* HTTP/1.x */ | |
998 rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked); | |
999 } | |
982 | 1000 |
983 if (rc == NGX_OK) { | 1001 if (rc == NGX_OK) { |
984 | 1002 |
985 /* a chunk has been parsed successfully */ | 1003 /* a chunk has been parsed successfully */ |
986 | 1004 |