summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Denoyelle <adenoyelle@haproxy.com>2023-05-15 11:35:45 +0200
committerAmaury Denoyelle <adenoyelle@haproxy.com>2023-05-16 17:53:45 +0200
commit1649469be1116e0acb869cd289244129321b50d0 (patch)
tree735dbf8ee8587267188e51d05f885c891e0eb653
parentc2d35dc84ab73c51d25ce8d115342d69ac335a06 (diff)
downloadhaproxy-1649469be1116e0acb869cd289244129321b50d0.tar.gz
MINOR: mux-quic: add trace to stream rcv_buf operation
Add traces to render each stream transition more explicit. Also, move ERR_PENDING to ERROR transition after other stream flags are set, as with the MUX H2 implementation. This is purely a cosmetic change and it should have no functional impact. This should be backported up to 2.7.
-rw-r--r--src/mux_quic.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mux_quic.c b/src/mux_quic.c
index 5fd8c7478..7db03210a 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -2644,10 +2644,11 @@ static size_t qc_recv_buf(struct stconn *sc, struct buffer *buf,
size_t count, int flags)
{
struct qcs *qcs = __sc_mux_strm(sc);
+ struct qcc *qcc = qcs->qcc;
size_t ret = 0;
char fin = 0;
- TRACE_ENTER(QMUX_EV_STRM_RECV, qcs->qcc->conn, qcs);
+ TRACE_ENTER(QMUX_EV_STRM_RECV, qcc->conn, qcs);
ret = qcs_http_rcv_buf(qcs, buf, count, &fin);
@@ -2656,11 +2657,10 @@ static size_t qc_recv_buf(struct stconn *sc, struct buffer *buf,
}
else {
se_fl_clr(qcs->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
- if (se_fl_test(qcs->sd, SE_FL_ERR_PENDING))
- se_fl_set(qcs->sd, SE_FL_ERROR);
/* Set end-of-input if FIN received and all data extracted. */
if (fin) {
+ TRACE_STATE("report end-of-input", QMUX_EV_STRM_RECV, qcc->conn, qcs);
se_fl_set(qcs->sd, SE_FL_EOI);
/* If request EOM is reported to the upper layer, it means the
@@ -2669,6 +2669,11 @@ static size_t qc_recv_buf(struct stconn *sc, struct buffer *buf,
se_expect_data(qcs->sd);
}
+ if (se_fl_test(qcs->sd, SE_FL_ERR_PENDING)) {
+ TRACE_STATE("report error", QMUX_EV_STRM_RECV, qcc->conn, qcs);
+ se_fl_set(qcs->sd, SE_FL_ERROR);
+ }
+
if (b_size(&qcs->rx.app_buf)) {
b_free(&qcs->rx.app_buf);
offer_buffers(NULL, 1);
@@ -2684,11 +2689,11 @@ static size_t qc_recv_buf(struct stconn *sc, struct buffer *buf,
BUG_ON(!ncb_data(&qcs->rx.ncbuf, 0));
qcs->flags &= ~QC_SF_DEM_FULL;
- if (!(qcs->qcc->flags & QC_CF_ERRL))
- tasklet_wakeup(qcs->qcc->wait_event.tasklet);
+ if (!(qcc->flags & QC_CF_ERRL))
+ tasklet_wakeup(qcc->wait_event.tasklet);
}
- TRACE_LEAVE(QMUX_EV_STRM_RECV, qcs->qcc->conn, qcs);
+ TRACE_LEAVE(QMUX_EV_STRM_RECV, qcc->conn, qcs);
return ret;
}