From: Christopher Faulet Date: Tue, 25 Jun 2019 19:31:26 +0000 (+0200) Subject: BUG/MINOR: htx: Save hdrs_bytes when the HTX start-line is replaced X-Git-Tag: v2.1-dev1~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bce046eea46f7ca83d0ee6213780135f0a0a625;p=thirdparty%2Fhaproxy.git BUG/MINOR: htx: Save hdrs_bytes when the HTX start-line is replaced The HTX start-line contains the number of bytes held by all headers as seen by the mux during the parsing. So it must not be updated during analysis. It was done when the start-line is replaced, so this update was removed at this place. But we still save it from the old start-line to not loose it. It should not be used outside the mux, but there is no reason to skip it. It is a bug, however it should have no impact. This patch must be backported to 2.0. --- diff --git a/src/htx.c b/src/htx.c index 814925985c..502184aff4 100644 --- a/src/htx.c +++ b/src/htx.c @@ -760,6 +760,7 @@ struct htx_sl *htx_replace_stline(struct htx *htx, struct htx_blk *blk, const st sl = htx_get_blk_ptr(htx, blk); tmp.info = sl->info; tmp.flags = sl->flags; + tmp.hdrs_bytes = sl->hdrs_bytes; sz = htx_get_blksz(blk); delta = sizeof(*sl) + p1.len + p2.len + p3.len - sz; @@ -778,8 +779,7 @@ struct htx_sl *htx_replace_stline(struct htx *htx, struct htx_blk *blk, const st sl = htx_get_blk_ptr(htx, blk); sl->info = tmp.info; sl->flags = tmp.flags; - if (sl->hdrs_bytes != -1) - sl->hdrs_bytes += delta; + sl->hdrs_bytes = tmp.hdrs_bytes; HTX_SL_P1_LEN(sl) = p1.len; HTX_SL_P2_LEN(sl) = p2.len;