[PATCH] HTTP/3: fixed $body_bytes_sent

Dmitry Plotnikov D.Plotnikov at F5.com
Fri Jun 23 11:26:34 UTC 2023


Look good to me.

Thanks,
Dmitry

From: nginx-devel <nginx-devel-bounces at nginx.org> on behalf of Sergey Kandaurov <pluknet at nginx.com>
Date: Friday, June 23, 2023 at 3:02 AM
To: nginx-devel at nginx.org <nginx-devel at nginx.org>
Subject: Re: [PATCH] HTTP/3: fixed $body_bytes_sent
EXTERNAL MAIL: nginx-devel-bounces at nginx.org

> On 20 Jun 2023, at 17:43, Sergey Kandaurov <pluknet at nginx.com> wrote:
>
> # HG changeset patch
> # User Sergey Kandaurov <pluknet at nginx.com>
> # Date 1687268079 -14400
> #      Tue Jun 20 17:34:39 2023 +0400
> # Node ID a95bffe430283bf25341ad9745ffe1199e7c2190
> # Parent  bf4bd5af4d7fdadab83616be9218604b658e3d84
> HTTP/3: fixed $body_bytes_sent.
>
> diff --git a/src/http/v3/ngx_http_v3_filter_module.c b/src/http/v3/ngx_http_v3_filter_module.c
> --- a/src/http/v3/ngx_http_v3_filter_module.c
> +++ b/src/http/v3/ngx_http_v3_filter_module.c
> @@ -540,6 +540,8 @@ ngx_http_v3_header_filter(ngx_http_reque
>     *ll = hl;
>     ll = &cl->next;
>
> +    r->header_size = n + (b->last - b->pos);
> +
>     if (r->headers_out.content_length_n >= 0
>         && !r->header_only && !r->expect_trailers)
>     {

This variant of the patch additionally cuts off the first (and only) DATA
frame header length from the variable value.  This better matches HTTP/1.1
non-"chunked transfer encoding" behaviour, when the content length is known
and no trailers expected.  Else, when chunked is used, all DATA-frame header
lengths (and trailers) are included similar to HTTP/1.1.

# HG changeset patch
# User Sergey Kandaurov <pluknet at nginx.com>
# Date 1687514427 -14400
#      Fri Jun 23 14:00:27 2023 +0400
# Node ID c681f4906d838ac45b517fada4c4274ade03fd3c
# Parent  77c1418916f7817a0d020f28d8a08f278a12fe43
HTTP/3: fixed $body_bytes_sent.

diff --git a/src/http/v3/ngx_http_v3_filter_module.c b/src/http/v3/ngx_http_v3_filter_module.c
--- a/src/http/v3/ngx_http_v3_filter_module.c
+++ b/src/http/v3/ngx_http_v3_filter_module.c
@@ -581,6 +581,7 @@ ngx_http_v3_header_filter(ngx_http_reque

     for (cl = out; cl; cl = cl->next) {
         h3c->total_bytes += cl->buf->last - cl->buf->pos;
+        r->header_size += cl->buf->last - cl->buf->pos;
     }

     return ngx_http_write_filter(r, out);

--
Sergey Kandaurov
_______________________________________________
nginx-devel mailing list
nginx-devel at nginx.org
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.nginx.org%2Fmailman%2Flistinfo%2Fnginx-devel&data=05%7C01%7Cd.plotnikov%40f5.com%7C33b0174f73f5418697c708db73d0eb25%7Cdd3dfd2f6a3b40d19be0bf8327d81c50%7C0%7C0%7C638231113373934840%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GzcQTuRhnL77VlQgxEEzCqQU2VFNl3yKXbNyDKTmzjA%3D&reserved=0<https://mailman.nginx.org/mailman/listinfo/nginx-devel>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20230623/7979e344/attachment.htm>


More information about the nginx-devel mailing list