From c202c740b57a189a546c1b7b3b68fe4ccec957ef Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 11 Apr 2023 08:59:08 +0200 Subject: [PATCH] BUG/MEDIUM: mux-h2: Never set SE_FL_EOS without SE_FL_EOI or SE_FL_ERROR When end-of-stream is reported by a H2 stream, we must take care to also report an error is end-of-input was not reported. Indeed, it is now mandatory to set SE_FL_EOI or SE_FL_ERROR flags when SE_FL_EOS is set. It is a 2.8-specific issue. No backport needed. --- src/mux_h2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mux_h2.c b/src/mux_h2.c index 7c553ad82..2f06db8dc 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6450,8 +6450,11 @@ static size_t h2_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, in if (h2s->flags & H2_SF_BODY_TUNNEL) se_fl_set(h2s->sd, SE_FL_EOS); } - if (h2c_read0_pending(h2c) || h2s->st == H2_SS_CLOSED) + if (h2c_read0_pending(h2c) || h2s->st == H2_SS_CLOSED) { se_fl_set(h2s->sd, SE_FL_EOS); + if (!se_fl_test(h2s->sd, SE_FL_EOI)) + se_fl_set(h2s->sd, SE_FL_ERROR); + } if (se_fl_test(h2s->sd, SE_FL_ERR_PENDING)) se_fl_set(h2s->sd, SE_FL_ERROR); if (b_size(&h2s->rxbuf)) {