]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: Count EOM in bytes sent when a HEADERS frame is formatted
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 15 May 2019 12:22:48 +0000 (14:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 May 2019 07:10:46 +0000 (09:10 +0200)
In HTX, when a HEADERS frame is formatted before sending it to the client or the
server, If an EOM is found because there is no body, we must count it in the
number bytes sent.

This patch must be backported to 1.9.

src/mux_h2.c

index 90c6a440c6f288b651fba13a337e1a3346fe6209..108d8eeba4950c1c1c5d628278dcdc72545ce206 100644 (file)
@@ -4481,8 +4481,10 @@ static size_t h2s_htx_frt_make_resp_headers(struct h2s *h2s, struct htx *htx)
                blk = htx_remove_blk(htx, blk);
        }
 
-       if (blk_end && htx_get_blk_type(blk_end) == HTX_BLK_EOM)
+       if (blk_end && htx_get_blk_type(blk_end) == HTX_BLK_EOM) {
+               ret += htx_get_blksz(blk_end);
                htx_remove_blk(htx, blk_end);
+       }
  end:
        return ret;
  full:
@@ -4721,8 +4723,10 @@ static size_t h2s_htx_bck_make_req_headers(struct h2s *h2s, struct htx *htx)
                blk = htx_remove_blk(htx, blk);
        }
 
-       if (blk_end && htx_get_blk_type(blk_end) == HTX_BLK_EOM)
+       if (blk_end && htx_get_blk_type(blk_end) == HTX_BLK_EOM) {
+               ret += htx_get_blksz(blk_end);
                htx_remove_blk(htx, blk_end);
+       }
 
  end:
        return ret;