summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faulet <cfaulet@haproxy.com>2023-02-23 14:52:09 +0100
committerChristopher Faulet <cfaulet@haproxy.com>2023-02-27 17:45:45 +0100
commit85eabfbf672c57e4ed082da1b96c95348b331320 (patch)
tree227f8bccb068c9df0ca882f7d618d111818d7ee3
parent72722c04b0a5e4baf8a147d002d393486b4f944d (diff)
downloadhaproxy-85eabfbf672c57e4ed082da1b96c95348b331320.tar.gz
MEDIUM: mux-quic: Don't expect data from server as long as request is unfinished
As for the H1 and H2 stream, the QUIC stream now states it does not expect data from the server as long as the request is unfinished. The aim is the same. We must be sure to not trigger a read timeout on server side if the client is still uploading data. From the moment the end of the request is received and forwarded to upper layer, the QUIC stream reports it expects to receive data from the opposite endpoint. This re-enables read timeout on the server side.
-rw-r--r--include/haproxy/mux_quic.h1
-rw-r--r--src/mux_quic.c8
2 files changed, 8 insertions, 1 deletions
diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h
index 1d5b962c0..44862317b 100644
--- a/include/haproxy/mux_quic.h
+++ b/include/haproxy/mux_quic.h
@@ -98,6 +98,7 @@ static inline struct stconn *qc_attach_sc(struct qcs *qcs, struct buffer *buf)
qcs->sd->se = qcs;
qcs->sd->conn = qcc->conn;
se_fl_set(qcs->sd, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
+ se_expect_no_data(qcs->sd);
/* TODO duplicated from mux_h2 */
sess->t_idle = tv_ms_elapsed(&sess->tv_accept, &now) - sess->t_handshake;
diff --git a/src/mux_quic.c b/src/mux_quic.c
index a78f8d4a4..a1cb66717 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -2423,9 +2423,15 @@ static size_t qc_recv_buf(struct stconn *sc, struct buffer *buf,
se_fl_set(qcs->sd, SE_FL_ERROR);
/* Set end-of-input if FIN received and all data extracted. */
- if (fin)
+ if (fin) {
se_fl_set(qcs->sd, SE_FL_EOI);
+ /* If request EOM is reported to the upper layer, it means the
+ * QCS now expects data from the opposite side.
+ */
+ se_expect_data(qcs->sd);
+ }
+
if (b_size(&qcs->rx.app_buf)) {
b_free(&qcs->rx.app_buf);
offer_buffers(NULL, 1);