From: Christopher Faulet Date: Tue, 11 Apr 2023 06:32:13 +0000 (+0200) Subject: BUG/MEDIUM: mux-h1: Report EOI when a TCP connection is upgraded to H2 X-Git-Tag: v2.8-dev8~190 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c393c9e3888d15a693635364835973d07b0f4982;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-h1: Report EOI when a TCP connection is upgraded to H2 When TCP connection is first upgrade to H1 then to H2, the stream-connector, created by the PT mux, must be destroyed because the H2 mux cannot inherit from it. When it is performed, the SE_FL_EOS flag is set but SE_FL_EOI must also be set. It is now required to never set SE_FL_EOS without SE_FL_EOI or SE_FL_ERROR. It is a 2.8-specific issue. No backport needed. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 511570496c..86dc754683 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2999,7 +2999,7 @@ static int h1_process(struct h1c * h1c) h1c->flags |= H1C_F_UPG_H2C; if (h1c->state == H1_CS_UPGRADING) { BUG_ON(!h1s); - se_fl_set(h1s->sd, SE_FL_EOS); /* Set EOS here to release the SC */ + se_fl_set(h1s->sd, SE_FL_EOI|SE_FL_EOS); /* Set EOS here to release the SC */ } TRACE_STATE("release h1c to perform H2 upgrade ", H1_EV_RX_DATA|H1_EV_H1C_WAKE); goto release; @@ -3156,7 +3156,7 @@ static int h1_process(struct h1c * h1c) BUG_ON(!h1s); if (h1c->flags & H1C_F_EOS) { - se_fl_set(h1s->sd, SE_FL_EOS); + se_fl_set(h1s->sd, SE_FL_EOI|SE_FL_EOS); TRACE_STATE("report EOS to SE", H1_EV_H1C_RECV, conn, h1s); } if (h1c->flags & (H1C_F_ERR_PENDING|H1C_F_ERROR)) {