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.
This commit is contained in:
Christopher Faulet 2021-04-22 09:43:47 +02:00
parent 8f685c11e0
commit 5e9b24f4b4

View File

@ -448,7 +448,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;
}