Skip to content

Commit

Permalink
BUG/MINOR: h1-htx: Don't flag response as bodyless when a tunnel is e…
Browse files Browse the repository at this point in the history
…stablished

This reverts commit 225a4d0.

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 a99d588)
Signed-off-by: Willy Tarreau <[email protected]>
(cherry picked from commit 550ea03)
Signed-off-by: Willy Tarreau <[email protected]>
  • Loading branch information
capflam authored and wtarreau committed Sep 9, 2024
1 parent 3adb1a6 commit 1557823
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/h1_htx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 1557823

Please sign in to comment.