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.
This commit is contained in:
Christopher Faulet 2023-04-11 08:59:08 +02:00
parent c393c9e388
commit c202c740b5

View File

@ -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)) {