diff options
author | Christopher Faulet <cfaulet@haproxy.com> | 2023-05-11 11:16:59 +0200 |
---|---|---|
committer | Christopher Faulet <cfaulet@haproxy.com> | 2023-05-11 15:37:04 +0200 |
commit | a272c39330f729e37a5e2b9447d421bfa12c2d92 (patch) | |
tree | 6b005f5414c4725f9198760c87beb3d6198b5239 | |
parent | 4cfb0019e65bce79953164eddf54c1bbb61add62 (diff) | |
download | haproxy-a272c39330f729e37a5e2b9447d421bfa12c2d92.tar.gz |
BUG/MEDIUM: mux-fcgi: Never set SE_FL_EOS without SE_FL_EOI or SE_FL_ERROR
When end-of-stream is reported by a FCGI stream, we must take care to also
report an error if 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.
-rw-r--r-- | src/mux_fcgi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 5ccf2aed3..f41578c76 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -3883,8 +3883,11 @@ static size_t fcgi_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, if (!(fstrm->h1m.flags & (H1_MF_VER_11|H1_MF_XFER_LEN))) se_fl_set(fstrm->sd, SE_FL_EOS); } - if (fcgi_conn_read0_pending(fconn)) + if (fcgi_conn_read0_pending(fconn)) { se_fl_set(fstrm->sd, SE_FL_EOS); + if (!se_fl_test(fstrm->sd, SE_FL_EOI)) + se_fl_set(fstrm->sd, SE_FL_ERROR); + } if (se_fl_test(fstrm->sd, SE_FL_ERR_PENDING)) se_fl_set(fstrm->sd, SE_FL_ERROR); fcgi_release_buf(fconn, &fstrm->rxbuf); |