[PATCH 1 of 2] HTTP/2: fix $bytes_sent variable

Valentin V. Bartenev vbart at nginx.com
Wed Mar 29 12:58:48 UTC 2017


On Sunday 26 March 2017 01:41:09 Piotr Sikora via nginx-devel wrote:
> # HG changeset patch
> # User Piotr Sikora <piotrsikora at google.com>
> # Date 1490516702 25200
> #      Sun Mar 26 01:25:02 2017 -0700
> # Node ID 74ee816e712ee3b731437947470383555653338d
> # Parent  22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
> HTTP/2: fix $bytes_sent variable.
> 
> Previously, its value accounted for payloads of HEADERS, CONTINUATION
> and DATA frames, as well as frame headers of HEADERS and DATA frames,
> but it didn't account for frame headers of CONTINUATION frames.
> 
> Signed-off-by: Piotr Sikora <piotrsikora at google.com>
> 
> diff -r 22be63bf21ed -r 74ee816e712e src/http/v2/ngx_http_v2_filter_module.c
> --- a/src/http/v2/ngx_http_v2_filter_module.c
> +++ b/src/http/v2/ngx_http_v2_filter_module.c
> @@ -769,6 +769,8 @@ ngx_http_v2_create_headers_frame(ngx_htt
>          rest -= frame_size;
>  
>          if (rest) {
> +            frame->length += NGX_HTTP_V2_FRAME_HEADER_SIZE;
> +
>              type = NGX_HTTP_V2_CONTINUATION_FRAME;
>              flags = NGX_HTTP_V2_NO_FLAG;
>              continue;

Committed.  Thanks.
http://hg.nginx.org/nginx/rev/afc60bd9008f

  wbr, Valentin V. Bartenev



More information about the nginx-devel mailing list