]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: htx: Preserve empty HTX messages with an unprocessed parsing error
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Apr 2019 09:33:17 +0000 (11:33 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Apr 2019 13:43:40 +0000 (15:43 +0200)
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.

include/common/htx.h

index 0eabf2400108764b00c3a7ba8a02db83bee9ebc8..9f339b877fb965a43b9d4db38363d7c40fab2a68 100644 (file)
@@ -727,7 +727,7 @@ static inline struct htx *htx_from_buf(struct buffer *buf)
 /* Upate <buf> accordingly to the HTX message <htx> */
 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);
        }