]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: h1_htx: Remove reverved block on error during contig chunks parsing
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2026 13:05:57 +0000 (15:05 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2026 16:36:34 +0000 (18:36 +0200)
In h1_parse_full_contig_chunks(), we first try to reserve the bigger HTX
DATA block as possible. It is ajusted at the end of chunks parsing or
removed if no data was copied. However, it should also be removed when a
parsing error is triggered. It could be an issue for http health checks and
haterm to properly handle errors.

This patch should be backported as far as 2.6.

src/h1_htx.c

index fbd6353473114b4aa2ae4e3af56db7e86c097ca3..55ddc6fb6f279903cdefbdc7a97a9e6340ad4e8c 100644 (file)
@@ -846,6 +846,7 @@ static size_t h1_parse_full_contig_chunks(struct h1m *h1m, struct htx **dsthtx,
 
   parsing_error:
        (*dsthtx)->flags |= HTX_FL_PARSING_ERROR;
+       htx_remove_blk(*dsthtx, htxret.blk);
        h1m->err_state = h1m->state;
        h1m->err_pos = ofs + end + ridx - start;
        return 0;