]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2/htx: Set hdrs_bytes on the SL when an HTX message is produced
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 15 May 2019 13:53:20 +0000 (15:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 May 2019 05:42:12 +0000 (07:42 +0200)
src/h2.c

index 4803137a9c64e044f07c9a1abdd7ffba45430647..6ec69c4346c546629975e84213ea0f91efef3b8c 100644 (file)
--- a/src/h2.c
+++ b/src/h2.c
@@ -590,6 +590,7 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms
        int phdr;
        int ret;
        int i;
+       uint32_t used = htx_used_space(htx);
        struct htx_sl *sl = NULL;
        unsigned int sl_flags = 0;
 
@@ -745,6 +746,9 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms
        /* now send the end of headers marker */
        htx_add_endof(htx, HTX_BLK_EOH);
 
+       /* Set bytes used in the HTX mesage for the headers now */
+       sl->hdrs_bytes = htx_used_space(htx) - used;
+
        ret = 1;
        return ret;
 
@@ -830,6 +834,7 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m
        int phdr;
        int ret;
        int i;
+       uint32_t used = htx_used_space(htx);
        struct htx_sl *sl = NULL;
        unsigned int sl_flags = 0;
 
@@ -928,6 +933,9 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m
        /* now send the end of headers marker */
        htx_add_endof(htx, HTX_BLK_EOH);
 
+       /* Set bytes used in the HTX mesage for the headers now */
+       sl->hdrs_bytes = htx_used_space(htx) - used;
+
        ret = 1;
        return ret;