]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: Also expect data when waiting for a tunnel establishment
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 May 2023 14:41:37 +0000 (16:41 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 May 2023 14:58:33 +0000 (16:58 +0200)
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.

src/mux_h2.c

index 44bb51fb3c32cf5c6ab48471c4e8520839a746d5..949ffb313b487bf793c89fec9f02e97ebb605861 100644 (file)
@@ -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.
                         */