[nginx] HTTP/2: fix $body_bytes_sent variable.

Valentin Bartenev vbart at nginx.com
Wed Mar 29 12:54:32 UTC 2017


details:   http://hg.nginx.org/nginx/rev/663e6a48bfcb
branches:  
changeset: 6953:663e6a48bfcb
user:      Piotr Sikora <piotrsikora at google.com>
date:      Sun Mar 26 01:25:03 2017 -0700
description:
HTTP/2: fix $body_bytes_sent variable.

Previously, its value included payloads and frame headers of HEADERS
and CONTINUATION frames.

Signed-off-by: Piotr Sikora <piotrsikora at google.com>

diffstat:

 src/http/v2/ngx_http_v2_filter_module.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r afc60bd9008f -r 663e6a48bfcb src/http/v2/ngx_http_v2_filter_module.c
--- a/src/http/v2/ngx_http_v2_filter_module.c	Sun Mar 26 01:25:02 2017 -0700
+++ b/src/http/v2/ngx_http_v2_filter_module.c	Sun Mar 26 01:25:03 2017 -0700
@@ -1211,6 +1211,9 @@ ngx_http_v2_headers_frame_handler(ngx_ht
                    "http2:%ui HEADERS frame %p was sent",
                    stream->node->id, frame);
 
+    stream->request->header_size += NGX_HTTP_V2_FRAME_HEADER_SIZE
+                                    + frame->length;
+
     ngx_http_v2_handle_frame(stream, frame);
 
     ngx_http_v2_handle_stream(h2c, stream);


More information about the nginx-devel mailing list