From 07b2b0aa146e1d24723192091e220e7ce50f2bfd Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 22 Apr 2021 09:43:47 +0200 Subject: [PATCH] BUG/MINOR: htx: Preserve HTX flags when draining data from an HTX message When all data of an HTX message are drained, we rely on htx_reset() to reinit the message state. However, the flags must be preserved. It is, among other things, important to preserve processing or parsing errors. This patch must be backported as far as 2.0. (cherry picked from commit 5e9b24f4b4e31958d97ce445bb993feb7ebc1421) Signed-off-by: Christopher Faulet --- src/htx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/htx.c b/src/htx.c index 91acee5..9239a22 100644 --- a/src/htx.c +++ b/src/htx.c @@ -445,7 +445,10 @@ struct htx_ret htx_drain(struct htx *htx, uint32_t count) struct htx_ret htxret = { .blk = NULL, .ret = 0 }; if (count == htx->data) { + uint32_t flags = htx->flags; + htx_reset(htx); + htx->flags = flags; /* restore flags */ htxret.ret = count; return htxret; } -- 1.7.10.4