From 15578238d34236097c625b9d3a46f7ec70af09b0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 9 Sep 2024 18:16:49 +0200 Subject: [PATCH] BUG/MINOR: h1-htx: Don't flag response as bodyless when a tunnel is established This reverts commit 225a4d02e1f6a12c0b4f3584949fad3339d71708. When a 200-OK response is replied to a CONNECT request or a 101-Switching-protocol, a tunnel is considered as established between the client and the server. However, we must not declare the reponse as bodyless. Of course, there is no payload, but tunneled data are expected. Because of this bug, the zero-copy forwarding is disabled on the server side. This patch must be backported as far as 2.9. (cherry picked from commit a99d58819f8184fb6f500807ddaf2371c5f1c110) Signed-off-by: Willy Tarreau (cherry picked from commit 550ea03db26249974f7049f6170935b52c1eb620) Signed-off-by: Willy Tarreau --- src/h1_htx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/h1_htx.c b/src/h1_htx.c index 562c0f2b6fdf..5b8b4e213221 100644 --- a/src/h1_htx.c +++ b/src/h1_htx.c @@ -288,7 +288,6 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx h1m->flags &= ~(H1_MF_CLEN|H1_MF_CHNK); h1m->flags |= H1_MF_XFER_LEN; h1m->curr_len = h1m->body_len = 0; - flags |= HTX_SL_F_BODYLESS_RESP; } else if ((h1m->flags & H1_MF_METH_HEAD) || (code >= 100 && code < 200) || (code == 204) || (code == 304)) {