From: Christopher Faulet Date: Mon, 1 Apr 2019 09:33:17 +0000 (+0200) Subject: BUG/MINOR: htx: Preserve empty HTX messages with an unprocessed parsing error X-Git-Tag: v2.0-dev3~339 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f192d683a73a4ab1afe67650bd05b6a4a64f7278;p=thirdparty%2Fhaproxy.git BUG/MINOR: htx: Preserve empty HTX messages with an unprocessed parsing error This let a chance to HTX analyzers to handle the error and send the appropriate response to the client. This patch must be backported to 1.9. --- diff --git a/include/common/htx.h b/include/common/htx.h index 0eabf24001..9f339b877f 100644 --- a/include/common/htx.h +++ b/include/common/htx.h @@ -727,7 +727,7 @@ static inline struct htx *htx_from_buf(struct buffer *buf) /* Upate accordingly to the HTX message */ static inline void htx_to_buf(struct htx *htx, struct buffer *buf) { - if (!htx->used) { + if (!htx->used && !(htx->flags & HTX_FL_PARSING_ERROR)) { htx_reset(htx); b_set_data(buf, 0); }