Skip to content

Commit a3e9a04

Browse files
committed
BUG/MEDIUM: mux-h1: Skip UNUSED htx block when formating the start line
UNUSED blocks were not properly handled when the H1 multiplexer was formatting the start line of a request or a response. UNUSED was ignored but not removed from HTX message. So the mux can loop infinitly on such block. It could be seen a a major issue but in fact it happens only if a very specific case on the reponse processing (at least I think so): the server must send an interim message (a 100-continue for intance) with the final response. HAProxy must receive both in same time and the final reponse must be intercepted (via a http-response return action for instance), In that case, the interim message is fowarded and the server final reponse is removed and replaced by a proxy error message. Now UNUSED htx blocks are properly skipped and removed. This patch must be backported as far as 3.0.
1 parent be68ecc commit a3e9a04

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/mux_h1.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,8 +2488,10 @@ static size_t h1_make_reqline(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
24882488
goto end;
24892489
type = htx_get_blk_type(blk);
24902490
sz = htx_get_blksz(blk);
2491-
if (type == HTX_BLK_UNUSED)
2491+
if (type == HTX_BLK_UNUSED) {
2492+
htx_remove_blk(htx, blk);
24922493
continue;
2494+
}
24932495
if (type != HTX_BLK_REQ_SL || sz > count)
24942496
goto error;
24952497
break;
@@ -2577,8 +2579,10 @@ static size_t h1_make_stline(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
25772579
type = htx_get_blk_type(blk);
25782580
sz = htx_get_blksz(blk);
25792581

2580-
if (type == HTX_BLK_UNUSED)
2582+
if (type == HTX_BLK_UNUSED) {
2583+
htx_remove_blk(htx, blk);
25812584
continue;
2585+
}
25822586
if (type != HTX_BLK_RES_SL || sz > count)
25832587
goto error;
25842588
break;

0 commit comments

Comments
 (0)