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.
This commit is contained in:
Christopher Faulet 2019-06-25 21:31:26 +02:00
parent 1933801136
commit 2bce046eea

View file

@ -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;