From: Christopher Faulet Date: Thu, 4 May 2023 14:41:37 +0000 (+0200) Subject: BUG/MINOR: mux-h2: Also expect data when waiting for a tunnel establishment X-Git-Tag: v2.8-dev10~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34f81d58153554ed4344acda6b202b6204a7bebe;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h2: Also expect data when waiting for a tunnel establishment When a client H2 stream is waiting for a tunnel establishment, it must state it expects data from server. It is the second fix that should fix regressions of the commit 2722c04b ("MEDIUM: mux-h2: Don't expect data from server as long as request is unfinished") It is a 2.8-specific bug. No backport needed. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 44bb51fb3c..949ffb313b 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1563,7 +1563,7 @@ static struct h2s *h2c_frt_stream_new(struct h2c *h2c, int id, struct buffer *in /* The request is not finished, don't expect data from the opposite side * yet */ - if (!(h2c->dff & (H2_F_HEADERS_END_STREAM| H2_F_DATA_END_STREAM))) + if (!(h2c->dff & (H2_F_HEADERS_END_STREAM| H2_F_DATA_END_STREAM|H2_SF_BODY_TUNNEL))) se_expect_no_data(h2s->sd); /* FIXME wrong analogy between ext-connect and websocket, this need to @@ -6466,7 +6466,7 @@ static size_t h2_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, in if (b_data(&h2s->rxbuf)) se_fl_set(h2s->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM); else { - if (!(h2c->flags & H2_CF_IS_BACK) && (h2s->flags & H2_SF_ES_RCVD)) { + if (!(h2c->flags & H2_CF_IS_BACK) && (h2s->flags & (H2_SF_BODY_TUNNEL|H2_SF_ES_RCVD))) { /* If request ES is reported to the upper layer, it means the * H2S now expects data from the opposite side. */